Commit f52d6e6e authored by Stefan Brüns's avatar Stefan Brüns
Browse files

Use new-style connects in thumbnailer, only connect once

parent f71d2aff
...@@ -43,6 +43,9 @@ GeoDataThumbnailer::GeoDataThumbnailer() ...@@ -43,6 +43,9 @@ GeoDataThumbnailer::GeoDataThumbnailer()
m_outtimer.setInterval(timeoutTime); m_outtimer.setInterval(timeoutTime);
m_outtimer.setSingleShot(true); m_outtimer.setSingleShot(true);
connect(&m_outtimer, SIGNAL(timeout()), &m_eventLoop, SLOT(quit())); connect(&m_outtimer, SIGNAL(timeout()), &m_eventLoop, SLOT(quit()));
MarbleModel *const model = m_marbleMap.model();
connect(model->treeModel(), &GeoDataTreeModel::added, this, &GeoDataThumbnailer::onGeoDataObjectAdded);
} }
...@@ -60,7 +63,6 @@ bool GeoDataThumbnailer::create(const QString &path, int width, int height, QIma ...@@ -60,7 +63,6 @@ bool GeoDataThumbnailer::create(const QString &path, int width, int height, QIma
m_loadingCompleted = false; m_loadingCompleted = false;
m_currentFilename = path; m_currentFilename = path;
connect(model->treeModel(), SIGNAL(added(GeoDataObject*)), this, SLOT(onGeoDataObjectAdded(GeoDataObject*)));
model->addGeoDataFile(path); model->addGeoDataFile(path);
if (! m_loadingCompleted) { if (! m_loadingCompleted) {
...@@ -83,7 +85,6 @@ bool GeoDataThumbnailer::create(const QString &path, int width, int height, QIma ...@@ -83,7 +85,6 @@ bool GeoDataThumbnailer::create(const QString &path, int width, int height, QIma
m_marbleMap.paint( geoPainter, QRect() ); // TODO: dirtyRect seems currently unused, make sure it is m_marbleMap.paint( geoPainter, QRect() ); // TODO: dirtyRect seems currently unused, make sure it is
} }
disconnect(model->treeModel(), SIGNAL(added(GeoDataObject*)), this, SLOT(onGeoDataObjectAdded(GeoDataObject*)));
model->removeGeoData(path); model->removeGeoData(path);
m_currentFilename.clear(); m_currentFilename.clear();
......
...@@ -45,10 +45,9 @@ public: // ThumbCreator API ...@@ -45,10 +45,9 @@ public: // ThumbCreator API
bool create(const QString &path, int width, int height, QImage &image) override; bool create(const QString &path, int width, int height, QImage &image) override;
Flags flags() const override; Flags flags() const override;
private Q_SLOTS: private:
void onGeoDataObjectAdded(GeoDataObject *object); void onGeoDataObjectAdded(GeoDataObject *object);
private:
MarbleMap m_marbleMap; MarbleMap m_marbleMap;
QString m_currentFilename; QString m_currentFilename;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment