Commit ee6580d5 authored by Laurent Montel's avatar Laurent Montel 😁

Fix warning

parent a797edae
...@@ -60,7 +60,7 @@ public: ...@@ -60,7 +60,7 @@ public:
q->connect(downloadThemesAction, SIGNAL(triggered(bool)), q, SLOT(slotDownloadHeaderThemes()) ); q->connect(downloadThemesAction, SIGNAL(triggered(bool)), q, SLOT(slotDownloadHeaderThemes()) );
q->connect( watch, SIGNAL(dirty(QString)), SLOT(directoryChanged()) ); q->connect( watch, SIGNAL(dirty(QString)), SLOT(directoryChanged()) );
updateThemesPath(); updateThemesPath(true);
} }
~Private() ~Private()
...@@ -93,14 +93,16 @@ public: ...@@ -93,14 +93,16 @@ public:
Q_EMIT q->updateThemes(); Q_EMIT q->updateThemes();
} }
void updateThemesPath() void updateThemesPath(bool init = false)
{ {
if ( !themesDirectories.isEmpty() ) { if (!init) {
Q_FOREACH (const QString &directory, themesDirectories) { if ( !themesDirectories.isEmpty() ) {
watch->removeDir( directory ); Q_FOREACH (const QString &directory, themesDirectories) {
} watch->removeDir( directory );
} else { }
return; } else {
return;
}
} }
// clear all previous theme information // clear all previous theme information
......
...@@ -35,7 +35,7 @@ TemplateManager::TemplateManager(const QString &relativeTemplateDir, PimCommon:: ...@@ -35,7 +35,7 @@ TemplateManager::TemplateManager(const QString &relativeTemplateDir, PimCommon::
initTemplatesDirectories(relativeTemplateDir); initTemplatesDirectories(relativeTemplateDir);
connect( mDirWatch, SIGNAL(dirty(QString)), SLOT(slotDirectoryChanged()) ); connect( mDirWatch, SIGNAL(dirty(QString)), SLOT(slotDirectoryChanged()) );
loadTemplates(); loadTemplates(true);
} }
TemplateManager::~TemplateManager() TemplateManager::~TemplateManager()
...@@ -62,14 +62,16 @@ void TemplateManager::initTemplatesDirectories(const QString &templatesRelativeP ...@@ -62,14 +62,16 @@ void TemplateManager::initTemplatesDirectories(const QString &templatesRelativeP
} }
} }
void TemplateManager::loadTemplates() void TemplateManager::loadTemplates(bool init)
{ {
if ( !mTemplatesDirectories.isEmpty() ) { if (!init) {
Q_FOREACH (const QString &directory, mTemplatesDirectories) { if ( !mTemplatesDirectories.isEmpty() ) {
mDirWatch->removeDir( directory ); Q_FOREACH (const QString &directory, mTemplatesDirectories) {
mDirWatch->removeDir( directory );
}
} else {
return;
} }
} else {
return;
} }
Q_FOREACH (const QString &directory, mTemplatesDirectories) { Q_FOREACH (const QString &directory, mTemplatesDirectories) {
......
...@@ -49,7 +49,7 @@ private Q_SLOTS: ...@@ -49,7 +49,7 @@ private Q_SLOTS:
void slotDirectoryChanged(); void slotDirectoryChanged();
private: private:
void loadTemplates(); void loadTemplates(bool init = false);
void initTemplatesDirectories(const QString &templatesRelativePath); void initTemplatesDirectories(const QString &templatesRelativePath);
TemplateInfo loadTemplate(const QString &themePath, const QString &defaultDesktopFileName); TemplateInfo loadTemplate(const QString &themePath, const QString &defaultDesktopFileName);
......
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