Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Unmaintained
KDE Pim
Commits
ee6580d5
Commit
ee6580d5
authored
Dec 19, 2014
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix warning
parent
a797edae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
16 deletions
+20
-16
grantleetheme/grantleethememanager.cpp
grantleetheme/grantleethememanager.cpp
+10
-8
pimcommon/templatewidgets/templatemanager.cpp
pimcommon/templatewidgets/templatemanager.cpp
+9
-7
pimcommon/templatewidgets/templatemanager.h
pimcommon/templatewidgets/templatemanager.h
+1
-1
No files found.
grantleetheme/grantleethememanager.cpp
View file @
ee6580d5
...
...
@@ -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,14 +93,16 @@ public:
Q_EMIT
q
->
updateThemes
();
}
void
updateThemesPath
()
void
updateThemesPath
(
bool
init
=
false
)
{
if
(
!
themesDirectories
.
isEmpty
()
)
{
Q_FOREACH
(
const
QString
&
directory
,
themesDirectories
)
{
watch
->
removeDir
(
directory
);
}
}
else
{
return
;
if
(
!
init
)
{
if
(
!
themesDirectories
.
isEmpty
()
)
{
Q_FOREACH
(
const
QString
&
directory
,
themesDirectories
)
{
watch
->
removeDir
(
directory
);
}
}
else
{
return
;
}
}
// clear all previous theme information
...
...
pimcommon/templatewidgets/templatemanager.cpp
View file @
ee6580d5
...
...
@@ -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,14 +62,16 @@ void TemplateManager::initTemplatesDirectories(const QString &templatesRelativeP
}
}
void
TemplateManager
::
loadTemplates
()
void
TemplateManager
::
loadTemplates
(
bool
init
)
{
if
(
!
mTemplatesDirectories
.
isEmpty
()
)
{
Q_FOREACH
(
const
QString
&
directory
,
mTemplatesDirectories
)
{
mDirWatch
->
removeDir
(
directory
);
if
(
!
init
)
{
if
(
!
mTemplatesDirectories
.
isEmpty
()
)
{
Q_FOREACH
(
const
QString
&
directory
,
mTemplatesDirectories
)
{
mDirWatch
->
removeDir
(
directory
);
}
}
else
{
return
;
}
}
else
{
return
;
}
Q_FOREACH
(
const
QString
&
directory
,
mTemplatesDirectories
)
{
...
...
pimcommon/templatewidgets/templatemanager.h
View file @
ee6580d5
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment