EditorManager: Auto-suspend editors

Adds an option (enabled by default) to close older documents when
opening new documents. These documents are put into "suspended" state,
similar to when restoring sessions: They editors and document are
removed, freeing the memory from their content and attached resources
(e.g. code model resources), but keeping the entry in the open editor
list (and history list, of course).
This is limited to editor/document types that can restore their UI state
when the document is reopened.

Task-number: QTCREATORBUG-10016
Change-Id: Icb5595aec950e3f666d42177fe2fd233954f2772
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
Eike Ziller
2016-06-13 12:59:35 +02:00
parent 98192159da
commit 92e352f4f0
11 changed files with 322 additions and 148 deletions

View File

@@ -42,6 +42,7 @@ AndroidManifestDocument::AndroidManifestDocument(AndroidManifestEditorWidget *ed
{
setId(Constants::ANDROID_MANIFEST_EDITOR_ID);
setMimeType(QLatin1String(Constants::ANDROID_MANIFEST_MIME_TYPE));
setSuspendAllowed(false);
connect(editorWidget, SIGNAL(guiChanged()),
this, SIGNAL(changed()));
}