Change configuration saving

* Save initial configuration after all the plugins are done with
  their delayed initialization

* Save configuration when the autosave timer triggers. The disks
  are in use at that time anyway and saving can be turned off
  completely

* Save settings when closing the options page dialog

Change-Id: Idcf9ad61e8f9b94899c580d5a855a883a62f8dc0
Reviewed-by: Majid Khan <mkhan3189@gmail.com>
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Tobias Hunger
2012-08-17 09:09:15 +02:00
parent e1ae73cf06
commit a68352f013
8 changed files with 23 additions and 10 deletions

View File

@@ -233,11 +233,6 @@ MainWindow::MainWindow() :
#if defined(Q_OS_MAC)
MacFullScreen::addFullScreen(this);
#endif
m_autoSaveSessionTimer = new QTimer(this);
m_autoSaveSessionTimer->setInterval(10000);
connect(m_autoSaveSessionTimer, SIGNAL(timeout()),
m_coreImpl, SIGNAL(saveSettingsRequested()));
}
void MainWindow::setSidebarVisible(bool visible)
@@ -377,13 +372,11 @@ void MainWindow::extensionsInitialized()
emit m_coreImpl->coreAboutToOpen();
show();
emit m_coreImpl->coreOpened();
m_autoSaveSessionTimer->start();
}
void MainWindow::closeEvent(QCloseEvent *event)
{
m_autoSaveSessionTimer->stop();
emit m_coreImpl->saveSettingsRequested();
ICore::saveSettings();
// Save opened files
bool cancelled;
@@ -979,7 +972,6 @@ bool MainWindow::showOptionsDialog(const QString &category,
void MainWindow::saveAll()
{
DocumentManager::saveModifiedDocumentsSilently(DocumentManager::modifiedDocuments());
emit m_coreImpl->saveSettingsRequested();
}
void MainWindow::exit()