Remove DocumentManager::currentFile, use DocumentManager::currentEditor

Change-Id: Ided1a14481cfbbcc49e901f3837e056582ff60e3
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Daniel Teske
2015-01-16 17:45:06 +01:00
parent a6ea380870
commit 1ed12d39f1
7 changed files with 20 additions and 55 deletions

View File

@@ -36,7 +36,6 @@
#include "projectexplorerconstants.h"
#include <utils/algorithm.h>
#include <coreplugin/documentmanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -68,7 +67,7 @@ ProjectTree::ProjectTree(QObject *parent)
{
s_instance = this;
connect(Core::DocumentManager::instance(), &Core::DocumentManager::currentFileChanged,
connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged,
this, &ProjectTree::documentManagerCurrentFileChanged);
connect(qApp, &QApplication::focusChanged,
@@ -167,7 +166,8 @@ Project *ProjectTree::projectForNode(Node *node)
void ProjectTree::updateFromDocumentManager(bool invalidCurrentNode)
{
const QString &fileName = Core::DocumentManager::currentFile();
Core::IDocument *document = Core::EditorManager::currentDocument();
const QString &fileName = document ? document->filePath().toString() : QString();
Node *currentNode = 0;
if (!invalidCurrentNode && m_currentNode && m_currentNode->path() == fileName)