forked from qt-creator/qt-creator
Git: Don't use variable manager to get current document path
There's just no sense in going through the expensive variable manager. Change-Id: I800766ed3c58f789de85e8ff000a8f702125b9ed Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -49,7 +49,6 @@
|
||||
#include <coreplugin/id.h>
|
||||
#include <coreplugin/documentmanager.h>
|
||||
#include <coreplugin/iversioncontrol.h>
|
||||
#include <coreplugin/variablemanager.h>
|
||||
|
||||
#include <texteditor/itexteditor.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
@@ -339,7 +338,9 @@ static inline QString msgParseFilesFailed()
|
||||
|
||||
static inline QString currentDocumentPath()
|
||||
{
|
||||
return Core::VariableManager::instance()->value("CurrentDocument:Path");
|
||||
if (Core::IEditor *editor = Core::EditorManager::currentEditor())
|
||||
return QFileInfo(editor->document()->fileName()).path();
|
||||
return QString();
|
||||
}
|
||||
|
||||
// ---------------- GitClient
|
||||
|
||||
Reference in New Issue
Block a user