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

Fix warning

parent a797edae
......@@ -60,7 +60,7 @@ public:
q->connect(downloadThemesAction, SIGNAL(triggered(bool)), q, SLOT(slotDownloadHeaderThemes()) );
q->connect( watch, SIGNAL(dirty(QString)), SLOT(directoryChanged()) );
updateThemesPath();
updateThemesPath(true);
}
~Private()
......@@ -93,8 +93,9 @@ public:
Q_EMIT q->updateThemes();
}
void updateThemesPath()
void updateThemesPath(bool init = false)
{
if (!init) {
if ( !themesDirectories.isEmpty() ) {
Q_FOREACH (const QString &directory, themesDirectories) {
watch->removeDir( directory );
......@@ -102,6 +103,7 @@ public:
} else {
return;
}
}
// clear all previous theme information
themes.clear();
......
......@@ -35,7 +35,7 @@ TemplateManager::TemplateManager(const QString &relativeTemplateDir, PimCommon::
initTemplatesDirectories(relativeTemplateDir);
connect( mDirWatch, SIGNAL(dirty(QString)), SLOT(slotDirectoryChanged()) );
loadTemplates();
loadTemplates(true);
}
TemplateManager::~TemplateManager()
......@@ -62,8 +62,9 @@ void TemplateManager::initTemplatesDirectories(const QString &templatesRelativeP
}
}
void TemplateManager::loadTemplates()
void TemplateManager::loadTemplates(bool init)
{
if (!init) {
if ( !mTemplatesDirectories.isEmpty() ) {
Q_FOREACH (const QString &directory, mTemplatesDirectories) {
mDirWatch->removeDir( directory );
......@@ -71,6 +72,7 @@ void TemplateManager::loadTemplates()
} else {
return;
}
}
Q_FOREACH (const QString &directory, mTemplatesDirectories) {
QDirIterator dirIt( directory, QStringList(), QDir::AllDirs | QDir::NoDotAndDotDot );
......
......@@ -49,7 +49,7 @@ private Q_SLOTS:
void slotDirectoryChanged();
private:
void loadTemplates();
void loadTemplates(bool init = false);
void initTemplatesDirectories(const QString &templatesRelativePath);
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