Support external editors for locator, projects and file system tree

When setting an external editor as the default editor in the MIME type
settings.

Other operations like File > Open, or when using navigation shortcuts
like Follow Symbol, and stepping with the debugger will still always
open the file within Qt Creator. The Open with... menu can still be used
to explicitly open a file in an external editor afterwards.

One of the use cases is to be able to open some files that would
otherwise unhelpfully be opened in Qt Creator's binary editor in the
systems default editor.

Fixes: QTCREATORBUG-13880
Change-Id: I852f097da8badd10de78b74e7078987447eebe98
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Eike Ziller
2021-11-11 11:51:11 +01:00
parent 0bbc465f61
commit 2fab827782
10 changed files with 107 additions and 50 deletions

View File

@@ -616,7 +616,9 @@ void FolderNavigationWidget::openItem(const QModelIndex &index)
if (m_fileSystemModel->isDir(index))
return;
const QString path = m_fileSystemModel->filePath(index);
Core::EditorManager::openEditor(FilePath::fromString(path));
Core::EditorManager::openEditor(FilePath::fromString(path),
{},
Core::EditorManager::AllowExternalEditor);
}
void FolderNavigationWidget::createNewFolder(const QModelIndex &parent)