forked from qt-creator/qt-creator
Save settings less aggressively.
Remove saving settings on auto-save, and only save settings when switching away from projects mode, instead of any mode switch. Change-Id: I3369b7f5ee785467d57c47e1a194a8ef989b98fb Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -72,7 +72,6 @@ struct ModeManagerPrivate
|
||||
QSignalMapper *m_signalMapper;
|
||||
Context m_addedContexts;
|
||||
int m_oldCurrent;
|
||||
bool m_saveSettingsOnModeChange;
|
||||
bool m_modeSelectorVisible;
|
||||
};
|
||||
|
||||
@@ -100,15 +99,12 @@ ModeManager::ModeManager(Internal::MainWindow *mainWindow,
|
||||
d->m_oldCurrent = -1;
|
||||
d->m_actionBar = new Internal::FancyActionBar(modeStack);
|
||||
d->m_modeStack->addCornerWidget(d->m_actionBar);
|
||||
d->m_saveSettingsOnModeChange = false;
|
||||
d->m_modeSelectorVisible = true;
|
||||
d->m_modeStack->setSelectionWidgetVisible(d->m_modeSelectorVisible);
|
||||
|
||||
connect(d->m_modeStack, SIGNAL(currentAboutToShow(int)), SLOT(currentTabAboutToChange(int)));
|
||||
connect(d->m_modeStack, SIGNAL(currentChanged(int)), SLOT(currentTabChanged(int)));
|
||||
connect(d->m_signalMapper, SIGNAL(mapped(int)), this, SLOT(slotActivateMode(int)));
|
||||
connect(ExtensionSystem::PluginManager::instance(), SIGNAL(initializationDone()), this, SLOT(handleStartup()));
|
||||
connect(ICore::instance(), SIGNAL(coreAboutToClose()), this, SLOT(handleShutdown()));
|
||||
}
|
||||
|
||||
void ModeManager::init()
|
||||
@@ -239,12 +235,6 @@ void ModeManager::enabledStateChanged()
|
||||
}
|
||||
}
|
||||
|
||||
void ModeManager::handleStartup()
|
||||
{ d->m_saveSettingsOnModeChange = true; }
|
||||
|
||||
void ModeManager::handleShutdown()
|
||||
{ d->m_saveSettingsOnModeChange = false; }
|
||||
|
||||
void ModeManager::aboutToRemoveObject(QObject *obj)
|
||||
{
|
||||
IMode *mode = Aggregation::query<IMode>(obj);
|
||||
@@ -283,11 +273,8 @@ void ModeManager::currentTabAboutToChange(int index)
|
||||
{
|
||||
if (index >= 0) {
|
||||
IMode *mode = d->m_modes.at(index);
|
||||
if (mode) {
|
||||
if (d->m_saveSettingsOnModeChange)
|
||||
ICore::saveSettings();
|
||||
if (mode)
|
||||
emit currentModeAboutToChange(mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user