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. --- shemov.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'shemov.cpp') diff --git a/shemov.cpp b/shemov.cpp index b8fb5fe..8b3e82b 100644 --- a/shemov.cpp +++ b/shemov.cpp @@ -33,12 +33,11 @@ #include "filesystemwidget.h" #include "fileview.h" #include "configurationdialog.h" -//#include "archiveeditdialog.h" #include "statisticsdialog.h" #include "filesystemfileproxy.h" #include "pictureviewer.h" #include "archivetreeview.h" -#include "smmodelsingleton.h" +#include "smglobals.h" #include "seriestreewidget.h" #include "newmoviewizard.h" #include "filestreewidget.h" @@ -92,7 +91,7 @@ void SheMov::closeEvent(QCloseEvent *event){ mFSWidget->writeSettings(); mFSWidget->pictureViewer()->close(); mATree->seriesWidget()->writeSettings(); - delete SmModelSingleton::instance(); + delete SmGlobals::instance(); writeSettings(); event->accept(); } -- cgit v1.2.3-70-g09d2