From b4dd48aaa81e0b7656b1fa7342a918313e192584 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Tue, 13 Jan 2009 23:08:20 +0000 Subject: some menu improvements git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@744 90c681e8-e032-0410-971d-27865f9a5e38 --- src/qmmpui/generalhandler.cpp | 5 +++++ src/qmmpui/generalhandler.h | 3 +++ 2 files changed, 8 insertions(+) (limited to 'src/qmmpui') 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 m_generals; CommandLineManager *m_commandLineManager; -- cgit v1.2.3-13-gbd6f