forked from qt-creator/qt-creator
Remove DocumentManager::currentFile, use DocumentManager::currentEditor
Change-Id: Ided1a14481cfbbcc49e901f3837e056582ff60e3 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
#include <coreplugin/fileiconprovider.h>
|
||||
#include <coreplugin/documentmanager.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/fileutils.h>
|
||||
#include <coreplugin/find/findplugin.h>
|
||||
@@ -199,17 +200,18 @@ void FolderNavigationWidget::setAutoSynchronization(bool sync)
|
||||
m_autoSync = sync;
|
||||
|
||||
if (m_autoSync) {
|
||||
connect(Core::DocumentManager::instance(), SIGNAL(currentFileChanged(QString)),
|
||||
this, SLOT(setCurrentFile(QString)));
|
||||
setCurrentFile(Core::DocumentManager::currentFile());
|
||||
connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged,
|
||||
this, &FolderNavigationWidget::setCurrentFile);
|
||||
setCurrentFile(Core::EditorManager::currentEditor());
|
||||
} else {
|
||||
disconnect(Core::DocumentManager::instance(), SIGNAL(currentFileChanged(QString)),
|
||||
this, SLOT(setCurrentFile(QString)));
|
||||
disconnect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged,
|
||||
this, &FolderNavigationWidget::setCurrentFile);
|
||||
}
|
||||
}
|
||||
|
||||
void FolderNavigationWidget::setCurrentFile(const QString &filePath)
|
||||
void FolderNavigationWidget::setCurrentFile(Core::IEditor *editor)
|
||||
{
|
||||
const QString filePath = editor->document()->filePath().toString();
|
||||
// Try to find directory of current file
|
||||
bool pathOpened = false;
|
||||
if (!filePath.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user