From ad322157891cec53a7b660629d7c244e75df81d5 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 24 Jul 2010 17:15:00 +0200 Subject: Act on doubleClick in FileTreeWidget When doubleclicking a picture in FileTreeWidget the pictureViewer is shown. Doubleclicking a movie file launches the default movie player. Since PictureViewer is now used in FileSystemWidget and ArchiveTreeView a global instance is needed. The appropriate place for this is a singleton. Since we already had a singleton for QAbstractItemModels I renamed it to SmGlobals and added a function to return a PictureViewer object. Renaming it was quite easy thanks to QtCreator's ability to rename variable names. --- smmodelsingleton.h | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 smmodelsingleton.h (limited to 'smmodelsingleton.h') diff --git a/smmodelsingleton.h b/smmodelsingleton.h deleted file mode 100644 index e8a3eaf..0000000 --- a/smmodelsingleton.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. -*/ - -#ifndef SMUBERMODELSINGLETON_H -#define SMUBERMODELSINGLETON_H - -#include - -class QAbstractItemModel; - -class SmModelSingleton : public QObject { - Q_OBJECT - public: - ~SmModelSingleton(); - static SmModelSingleton *instance(); - QAbstractItemModel *model(const QString &which); - - private: - SmModelSingleton() {} - SmModelSingleton(const SmModelSingleton &other); - SmModelSingleton &operator=(const SmModelSingleton &other); - static SmModelSingleton *mInstance; - QHash mModels; -}; - -#endif -- cgit v1.2.3-70-g09d2