account for disappearing operation slugs

main
Joel Smith 2020-07-27 09:47:09 -07:00
parent 2ef29c8be2
commit 7c0fa381b2
1 changed files with 6 additions and 0 deletions

View File

@ -104,11 +104,13 @@ TrayManager::~TrayManager() {
}
void TrayManager::cleanChooseOpSubmenu() {
// delete all of the existing events
for (QAction* act : allOperationActions) {
chooseOpSubmenu->removeAction(act);
delete act;
}
allOperationActions.clear();
selectedAction = nullptr; // clear the selected action to ensure no funny business
}
void TrayManager::wireUi() {
@ -310,6 +312,10 @@ void TrayManager::onOperationListUpdated(bool success,
allOperationActions.push_back(newAction);
chooseOpSubmenu->addAction(newAction);
}
if (selectedAction == nullptr) {
AppSettings::getInstance().setOperationDetails("", "");
}
}
else {
chooseOpStatusAction->setText(tr("Unable to load operations"));