[Marble-commits] KDE/kdeedu/marble/src/lib

Jens-Michael Hoffmann jensmh at gmx.de
Fri Oct 9 15:08:31 CEST 2009


SVN commit 1033090 by jmhoffmann:

Move creation and deletion of member variables into MapThemeManagerPrivate ctor/dtor.

 M  +15 -4     MapThemeManager.cpp  


--- trunk/KDE/kdeedu/marble/src/lib/MapThemeManager.cpp #1033089:1033090
@@ -43,16 +43,29 @@
 class MapThemeManagerPrivate
 {
 public:
+    MapThemeManagerPrivate();
+    ~MapThemeManagerPrivate();
     QStandardItemModel* m_mapThemeModel;
     QFileSystemWatcher* m_fileSystemWatcher;
 };
 
+MapThemeManagerPrivate::MapThemeManagerPrivate()
+    : m_mapThemeModel( new QStandardItemModel( 0, 3 ) ),
+      m_fileSystemWatcher( new QFileSystemWatcher )
+{
+}
 
+MapThemeManagerPrivate::~MapThemeManagerPrivate()
+{
+    delete m_mapThemeModel;
+    delete m_fileSystemWatcher;
+}
+
+
 MapThemeManager::MapThemeManager(QObject *parent)
     : QObject(parent),
     d(new MapThemeManagerPrivate)
 {
-    d->m_mapThemeModel = new QStandardItemModel( 0, 3 );
     initFileSystemWatcher();
 
     // Delayed model initialization
@@ -61,8 +74,6 @@
 
 MapThemeManager::~MapThemeManager()
 {
-    delete d->m_mapThemeModel;
-    delete d->m_fileSystemWatcher;
     delete d;
 }
 
@@ -73,7 +84,7 @@
     foreach(const QString& path, paths)
         qDebug() << "path to watch: " << path;
 */
-    d->m_fileSystemWatcher = new QFileSystemWatcher( paths, this );
+    d->m_fileSystemWatcher->addPaths( paths );
     connect( d->m_fileSystemWatcher, SIGNAL( directoryChanged( const QString& )),
              this, SLOT( directoryChanged( const QString& )));
     connect( d->m_fileSystemWatcher, SIGNAL( fileChanged( const QString& )),


More information about the Marble-commits mailing list