diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 433e74b35fc..7f344ecd95f 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1970,6 +1970,7 @@ void EditorManagerPrivate::autoSave() if (!errors.isEmpty()) QMessageBox::critical(ICore::mainWindow(), tr("File Error"), errors.join(QLatin1Char('\n'))); + emit m_instance->autoSaved(); } void EditorManagerPrivate::handleContextChange(const QList &context) diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h index afcd082d68e..46656e51b0c 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.h +++ b/src/plugins/coreplugin/editormanager/editormanager.h @@ -185,6 +185,7 @@ signals: void editorsClosed(QList editors); void findOnFileSystemRequest(const QString &path); void aboutToSave(IDocument *document); + void autoSaved(); public slots: static void saveDocument(); diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 862359e66a0..a441ca87c5b 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1061,6 +1061,10 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er connect(ICore::instance(), &ICore::saveSettingsRequested, dd, &ProjectExplorerPluginPrivate::savePersistentSettings); + connect(EditorManager::instance(), &EditorManager::autoSaved, this, [this] { + if (!dd->m_shuttingDown && !SessionManager::loadingSession()) + SessionManager::save(); + }); addAutoReleasedObject(new ProjectTreeWidgetFactory); addAutoReleasedObject(new FolderNavigationWidgetFactory);