summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/coreplugin/documentmanager.cpp18
-rw-r--r--src/plugins/coreplugin/documentmanager.h1
-rw-r--r--src/plugins/coreplugin/editormanager/editormanager.cpp5
3 files changed, 5 insertions, 19 deletions
diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp
index 7e68576cc1..384e9f4070 100644
--- a/src/plugins/coreplugin/documentmanager.cpp
+++ b/src/plugins/coreplugin/documentmanager.cpp
@@ -216,8 +216,6 @@ DocumentManager::DocumentManager(QObject *parent)
{
d = new DocumentManagerPrivate;
m_instance = this;
- connect(ICore::instance(), SIGNAL(contextChanged(QList<Core::IContext*>,Core::Context)),
- this, SLOT(syncWithEditor(QList<Core::IContext*>)));
qApp->installEventFilter(this);
readSettings();
@@ -1129,22 +1127,6 @@ void DocumentManager::checkForReload()
// dump();
}
-void DocumentManager::syncWithEditor(const QList<Core::IContext *> &context)
-{
- if (context.isEmpty())
- return;
-
- Core::IEditor *editor = Core::EditorManager::currentEditor();
- if (!editor || editor->document()->isTemporary())
- return;
- foreach (IContext *c, context) {
- if (editor->widget() == c->widget()) {
- setCurrentFile(editor->document()->filePath());
- break;
- }
- }
-}
-
/*!
Adds the \a fileName to the list of recent files. Associates the file to
be reopened with the editor that has the specified \a editorId, if possible.
diff --git a/src/plugins/coreplugin/documentmanager.h b/src/plugins/coreplugin/documentmanager.h
index 1144a15d29..8fe47ba508 100644
--- a/src/plugins/coreplugin/documentmanager.h
+++ b/src/plugins/coreplugin/documentmanager.h
@@ -163,7 +163,6 @@ private slots:
void checkForNewFileName();
void checkForReload();
void changedFile(const QString &file);
- void syncWithEditor(const QList<Core::IContext *> &context);
private:
explicit DocumentManager(QObject *parent);
diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp
index 3b130c5120..172f98f3cc 100644
--- a/src/plugins/coreplugin/editormanager/editormanager.cpp
+++ b/src/plugins/coreplugin/editormanager/editormanager.cpp
@@ -526,6 +526,8 @@ void EditorManager::handleContextChange(const QList<Core::IContext *> &context)
d->m_scheduledCurrentEditor = editor;
QTimer::singleShot(0, m_instance, SLOT(setCurrentEditorFromContextChange()));
} else {
+ if (editor && !editor->document()->isTemporary())
+ DocumentManager::setCurrentFile(editor->document()->filePath());
updateActions();
}
}
@@ -1027,6 +1029,9 @@ void EditorManager::setCurrentEditorFromContextChange()
IEditor *newCurrent = d->m_scheduledCurrentEditor;
d->m_scheduledCurrentEditor = 0;
setCurrentEditor(newCurrent);
+ if (!newCurrent->document()->isTemporary())
+ DocumentManager::setCurrentFile(newCurrent->document()->filePath());
+
}
void EditorManager::closeEditor(Core::IEditor *editor, bool askAboutModifiedEditors)