Snippets: Move code from the manager to the collection.

Reloading and synchronizing are now directly accessible from
the collection interface.
This commit is contained in:
Leandro Melo
2010-11-23 11:31:57 +01:00
parent 4a8bdaf843
commit 22c9b652b0
5 changed files with 164 additions and 175 deletions

View File

@@ -360,14 +360,16 @@ void SnippetsSettingsPagePrivate::apply()
if (settingsChanged())
writeSettings();
if (m_snippetsCollectionChanged)
SnippetsManager::instance()->persistSnippetsCollection();
if (m_snippetsCollectionChanged) {
SnippetsManager::instance()->snippetsCollection()->synchronize();
m_snippetsCollectionChanged = false;
}
}
void SnippetsSettingsPagePrivate::finish()
{
if (m_snippetsCollectionChanged) {
SnippetsManager::instance()->reloadSnippetsCollection();
SnippetsManager::instance()->snippetsCollection()->reload();
m_snippetsCollectionChanged = false;
}
}