forked from qt-creator/qt-creator
Core: Give a hint why saving of settings are requested
Not all requests are the same, handling code might want to act differently on different request reasons. Main driver here is the handling of the debugger/analyzer main window state savings which depends on actual visibility of certain windows. Change-Id: I87b2a9149e3d09d27bc14b44aace9f2e0686db04 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -330,7 +330,7 @@ ICore::ICore(MainWindow *mainwindow)
|
||||
m_mainwindow = mainwindow;
|
||||
// Save settings once after all plugins are initialized:
|
||||
connect(PluginManager::instance(), &PluginManager::initializationDone,
|
||||
this, &ICore::saveSettings);
|
||||
this, [] { ICore::saveSettings(ICore::InitializationDone); });
|
||||
connect(PluginManager::instance(), &PluginManager::testsFinished, [this] (int failedTests) {
|
||||
emit coreAboutToClose();
|
||||
if (failedTests != 0)
|
||||
@@ -690,9 +690,9 @@ void ICore::setupScreenShooter(const QString &name, QWidget *w, const QRect &rc)
|
||||
new ScreenShooter(w, name, rc);
|
||||
}
|
||||
|
||||
void ICore::saveSettings()
|
||||
void ICore::saveSettings(SaveSettingsReason reason)
|
||||
{
|
||||
emit m_instance->saveSettingsRequested();
|
||||
emit m_instance->saveSettingsRequested(reason);
|
||||
m_mainwindow->saveSettings();
|
||||
|
||||
ICore::settings(QSettings::SystemScope)->sync();
|
||||
|
||||
Reference in New Issue
Block a user