diff --git a/src/controller.cpp b/src/controller.cpp index bbade028..a5918b2f 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -45,7 +45,6 @@ Controller::Controller(QObject *parent) : QObject(parent), qApp->installNativeEventFilter(m_nativeEventFilter); connect(m_nativeEventFilter, &NativeEventFilter::activated, this, &Controller::slotPrintHotkey); - QString StyleSheet = Button::getStyle(); qApp->setStyleSheet(StyleSheet); @@ -94,6 +93,18 @@ void Controller::initDefaults() { buttons << i; } settings.setValue("buttons", QVariant::fromValue(buttons)); + } else { + // disabled buttons cleanup + int higherValue = static_cast(Button::Type::last) - 1; + QList buttons = settings.value("buttons").value >(); + + QMutableListIterator i(buttons); + while (i.hasNext()) { + if (i.next() > higherValue) { + i.remove(); + } + } + settings.setValue("buttons", QVariant::fromValue(buttons)); } }