forked from qt-creator/qt-creator
Core: Fix that core settings like shortcuts were only saved at shutdown
Save them also whenever a settings save is requested, which e.g. also happens when closing the options dialog. Change-Id: Ic20f1007381a4d0a8157f17fd24c0d8ea24907ee Task-number: QTCREATORBUG-16576 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -596,6 +596,7 @@ QString ICore::systemInformation()
|
|||||||
void ICore::saveSettings()
|
void ICore::saveSettings()
|
||||||
{
|
{
|
||||||
emit m_instance->saveSettingsRequested();
|
emit m_instance->saveSettingsRequested();
|
||||||
|
m_mainwindow->saveSettings();
|
||||||
|
|
||||||
ICore::settings(QSettings::SystemScope)->sync();
|
ICore::settings(QSettings::SystemScope)->sync();
|
||||||
ICore::settings(QSettings::UserScope)->sync();
|
ICore::settings(QSettings::UserScope)->sync();
|
||||||
|
|||||||
@@ -388,7 +388,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
|
|||||||
|
|
||||||
emit m_coreImpl->coreAboutToClose();
|
emit m_coreImpl->coreAboutToClose();
|
||||||
|
|
||||||
writeSettings();
|
saveWindowSettings();
|
||||||
|
|
||||||
m_navigationWidget->closeSubWidgets();
|
m_navigationWidget->closeSubWidgets();
|
||||||
|
|
||||||
@@ -980,7 +980,7 @@ void MainWindow::readSettings()
|
|||||||
m_rightPaneWidget->readSettings(settings);
|
m_rightPaneWidget->readSettings(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::writeSettings()
|
void MainWindow::saveSettings()
|
||||||
{
|
{
|
||||||
QSettings *settings = PluginManager::settings();
|
QSettings *settings = PluginManager::settings();
|
||||||
settings->beginGroup(QLatin1String(settingsGroup));
|
settings->beginGroup(QLatin1String(settingsGroup));
|
||||||
@@ -988,6 +988,19 @@ void MainWindow::writeSettings()
|
|||||||
if (!(m_overrideColor.isValid() && StyleHelper::baseColor() == m_overrideColor))
|
if (!(m_overrideColor.isValid() && StyleHelper::baseColor() == m_overrideColor))
|
||||||
settings->setValue(QLatin1String(colorKey), StyleHelper::requestedBaseColor());
|
settings->setValue(QLatin1String(colorKey), StyleHelper::requestedBaseColor());
|
||||||
|
|
||||||
|
settings->endGroup();
|
||||||
|
|
||||||
|
DocumentManager::saveSettings();
|
||||||
|
ActionManager::saveSettings();
|
||||||
|
EditorManagerPrivate::saveSettings();
|
||||||
|
m_navigationWidget->saveSettings(settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::saveWindowSettings()
|
||||||
|
{
|
||||||
|
QSettings *settings = PluginManager::settings();
|
||||||
|
settings->beginGroup(QLatin1String(settingsGroup));
|
||||||
|
|
||||||
// On OS X applications usually do not restore their full screen state.
|
// On OS X applications usually do not restore their full screen state.
|
||||||
// To be able to restore the correct non-full screen geometry, we have to put
|
// To be able to restore the correct non-full screen geometry, we have to put
|
||||||
// the window out of full screen before saving the geometry.
|
// the window out of full screen before saving the geometry.
|
||||||
@@ -999,11 +1012,6 @@ void MainWindow::writeSettings()
|
|||||||
settings->setValue(QLatin1String(modeSelectorVisibleKey), ModeManager::isModeSelectorVisible());
|
settings->setValue(QLatin1String(modeSelectorVisibleKey), ModeManager::isModeSelectorVisible());
|
||||||
|
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
|
|
||||||
DocumentManager::saveSettings();
|
|
||||||
ActionManager::saveSettings();
|
|
||||||
EditorManagerPrivate::saveSettings();
|
|
||||||
m_navigationWidget->saveSettings(settings);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::updateAdditionalContexts(const Context &remove, const Context &add,
|
void MainWindow::updateAdditionalContexts(const Context &remove, const Context &add,
|
||||||
|
|||||||
@@ -111,6 +111,8 @@ public:
|
|||||||
|
|
||||||
void addPreCloseListener(const std::function<bool()> &listener);
|
void addPreCloseListener(const std::function<bool()> &listener);
|
||||||
|
|
||||||
|
void saveSettings();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void newItemDialogRunningChanged();
|
void newItemDialogRunningChanged();
|
||||||
|
|
||||||
@@ -149,7 +151,7 @@ private:
|
|||||||
void registerDefaultActions();
|
void registerDefaultActions();
|
||||||
|
|
||||||
void readSettings();
|
void readSettings();
|
||||||
void writeSettings();
|
void saveWindowSettings();
|
||||||
|
|
||||||
ICore *m_coreImpl;
|
ICore *m_coreImpl;
|
||||||
QStringList m_aboutInformation;
|
QStringList m_aboutInformation;
|
||||||
|
|||||||
Reference in New Issue
Block a user