diff --git a/src/blackgui/dockwidget.cpp b/src/blackgui/dockwidget.cpp index b44ccb5cd..87e826106 100644 --- a/src/blackgui/dockwidget.cpp +++ b/src/blackgui/dockwidget.cpp @@ -382,7 +382,7 @@ namespace BlackGui } // State actions (windows state) - contextMenu->addAction(CIcons::load16(), "Restore", this, &CDockWidget::restoreFromSettings); + contextMenu->addAction(CIcons::load16(), "Restore from settings", this, &CDockWidget::restoreFromSettings); contextMenu->addAction(CIcons::save16(), "Save state", this, &CDockWidget::saveCurrentStateToSettings); contextMenu->addAction(CIcons::refresh16(), "Reset to defaults", this, &CDockWidget::resetSettings); contextMenu->addAction(CIcons::refresh16(), "Reset position", this, &CDockWidget::resetPosition); diff --git a/src/blackgui/guiapplication.cpp b/src/blackgui/guiapplication.cpp index a372c01ed..4779fd00b 100644 --- a/src/blackgui/guiapplication.cpp +++ b/src/blackgui/guiapplication.cpp @@ -401,7 +401,6 @@ namespace BlackGui } if (m_saveMainWidgetState && !this->isSet(m_cmdWindowSizeReset)) { - const Qt::KeyboardModifiers km = QGuiApplication::queryKeyboardModifiers(); const bool shiftAlt = km.testFlag(Qt::ShiftModifier) && km.testFlag(Qt::AltModifier); if (!shiftAlt) { this->restoreWindowGeometryAndState(); } diff --git a/src/blackgui/infoarea.cpp b/src/blackgui/infoarea.cpp index 70cd22b1b..77f6742c8 100644 --- a/src/blackgui/infoarea.cpp +++ b/src/blackgui/infoarea.cpp @@ -99,7 +99,7 @@ namespace BlackGui menu->addSeparator(); QMenu *subMenuToggleFloat = new QMenu("Toggle Float/Dock", menu); QMenu *subMenuDisplay = new QMenu("Display", menu); - QMenu *subMenuRestore = new QMenu("Restore", menu); + QMenu *subMenuRestore = new QMenu("Restore from settings", menu); QMenu *subMenuResetPositions = new QMenu("Reset position", menu); subMenuRestore->setIcon(CIcons::load16()); subMenuResetPositions->setIcon(CIcons::refresh16()); @@ -404,8 +404,9 @@ namespace BlackGui { const QObject *sender = QObject::sender(); const QAction *action = qobject_cast(sender); - Q_ASSERT(action); - int index = action->data().toInt(); + BLACK_VERIFY(action); + if (!action) { return; } + const int index = action->data().toInt(); this->selectArea(index); } @@ -413,8 +414,9 @@ namespace BlackGui { const QObject *sender = QObject::sender(); const QAction *action = qobject_cast(sender); - Q_ASSERT(action); - int index = action->data().toInt(); + BLACK_VERIFY(action); + if (!action) { return; } + const int index = action->data().toInt(); this->resetPosition(index); } @@ -422,18 +424,19 @@ namespace BlackGui { const QObject *sender = QObject::sender(); const QAction *action = qobject_cast(sender); - Q_ASSERT(action); - int index = action->data().toInt(); + BLACK_VERIFY(action); + if (!action) { return; } + const int index = action->data().toInt(); this->toggleFloatingByIndex(index); } void CInfoArea::restoreDockWidgetInfoArea() { const QObject *sender = QObject::sender(); - Q_ASSERT(sender); const QAction *action = qobject_cast(sender); - Q_ASSERT(action); - int index = action->data().toInt(); + BLACK_VERIFY(action); + if (!action) { return; } + const int index = action->data().toInt(); this->restoreDockWidgetInfoAreaByIndex(index); } @@ -442,7 +445,7 @@ namespace BlackGui if (!this->isValidAreaIndex(areaIndex)) { return; } CDockWidgetInfoArea *dw = m_dockWidgetInfoAreas.at(areaIndex); Q_ASSERT(dw); - if (!dw) return; + if (!dw) { return; } dw->restoreFromSettings(); }