diff options
Diffstat (limited to 'src/qmmpui')
| -rw-r--r-- | src/qmmpui/generalhandler.cpp | 5 | ||||
| -rw-r--r-- | src/qmmpui/generalhandler.h | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/qmmpui/generalhandler.cpp b/src/qmmpui/generalhandler.cpp index d46c0e0e5..f047745a1 100644 --- a/src/qmmpui/generalhandler.cpp +++ b/src/qmmpui/generalhandler.cpp @@ -110,6 +110,7 @@ void GeneralHandler::executeCommand(const QString &opt_str) void GeneralHandler::addAction(QAction *action, MenuType type) { + connect(action, SIGNAL(destroyed (QObject *)), SLOT(removeAction(QObject*))); switch ((int) type) { case TOOLS_MENU: @@ -175,3 +176,7 @@ GeneralHandler* GeneralHandler::instance() return m_instance; } +void GeneralHandler::removeAction(QObject *action) +{ + removeAction((QAction *) action); +} diff --git a/src/qmmpui/generalhandler.h b/src/qmmpui/generalhandler.h index 73386ac0a..5e99bff80 100644 --- a/src/qmmpui/generalhandler.h +++ b/src/qmmpui/generalhandler.h @@ -69,6 +69,9 @@ signals: void exitCalled(); void toggleVisibilityCalled(); +private slots: + void removeAction(QObject *action); + private: QMap <GeneralFactory*, General*> m_generals; CommandLineManager *m_commandLineManager; |
