From 92c0ab74e931ba8846de50cb0572df94472a40ce Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 14 May 2010 13:52:30 +0200 Subject: Added "Play selected" and "Open with" to ArchiveViewWidget Implemented "Play selected movies" and "Open with" functions in ArchiveViewWidget. Also fixed a potential crash when re-creating the "Open with"-submenus. It's not possible to remove actions from an ActionGroup while iterating over the group with foreach. The ActionGroup is modified when calling removeAction() thus throwing the iterator of the loop off. Solution: First remove the actions from the ActionGroup and then delete the ActionGroup itself. The QObject destructor will take care of the contained Actions. --- shemov.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'shemov.h') diff --git a/shemov.h b/shemov.h index 8d5ea56..5d6dc46 100644 --- a/shemov.h +++ b/shemov.h @@ -51,7 +51,8 @@ class SheMov : public QMainWindow { void createStatusbar(); void createActions(); void createMenus(); - void createOpenWithMenu(); + void createOpenWithMenuFS(); + void createOpenWithMenuAV(); void createExtractMenu(); void writeSettings(); void readSettings(); @@ -89,21 +90,26 @@ class SheMov : public QMainWindow { QAction *mAboutShemovA; QAction *mAboutQtA; QAction *mStatisticsA; - QAction *mPlaySelectedA; - QAction *mOpenWithMenuA; + QAction *mPlaySelectedFSA; + QAction *mPlaySelectedAVA; + QAction *mOpenWithMenuFSA; + QAction *mOpenWithMenuAVA; QAction *mRenameMenuA; QList mExtractToA; - QActionGroup *mOpenWithGroup; + QActionGroup *mOpenWithGroupFS; + QActionGroup *mOpenWithGroupAV; //EndActions QSignalMapper *mRenameMapper; QSignalMapper *mExtractMapper; - QSignalMapper *mOpenWithMapper; + QSignalMapper *mOpenWithMapperFS; + QSignalMapper *mOpenWithMapperAV; QMenu *mExtractMenu; QMenu *mEditFSMenu; QMenu *mEditArchiveMenu; - QMenu *mOpenWithMenu; + QMenu *mOpenWithMenuFS; + QMenu *mOpenWithMenuAV; QMenu *mRenameMenu; QAction *mEditFSMenuA; QAction *mEditArchiveMenuA; -- cgit v1.2.3-70-g09d2