aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-10-04 11:58:39 (GMT)
committerMontel Laurent <montel@kde.org>2016-10-04 11:58:39 (GMT)
commite80bb74227dea5047060a64366f9192214ea0def (patch)
tree0072860bf3f5ce4362c10f282a5aa9b3bc622564
parent7b36b973b0ef856e04877b8fbbe969aa4ccb6e0d (diff)
Try to fix crash
-rw-r--r--src/grantleethememanager.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/grantleethememanager.cpp b/src/grantleethememanager.cpp
index 302ac56..1b23eb9 100644
--- a/src/grantleethememanager.cpp
+++ b/src/grantleethememanager.cpp
@@ -165,16 +165,18 @@ public:
return;
}
QString themeActivated;
+
+ QAction *selectedAction = actionGroup->checkedAction();
+ if (selectedAction) {
+ themeActivated = selectedAction->data().toString();
+ }
+
Q_FOREACH (KToggleAction *action, themesActionList) {
- if (action->isChecked()) {
- themeActivated = action->data().toString();
- }
actionGroup->removeAction(action);
+ menu->removeAction(action);
if (actionCollection) {
actionCollection->removeAction(action);
}
- menu->removeAction(action);
- delete action;
}
menu->removeAction(separatorAction);
menu->removeAction(downloadThemesAction);