EditorManager: Remove QString openEditor(At) overloads

In favor of the FilePath/Link ones.

Change-Id: I5caf9e0f8de304ff4ee12329557aa50a6f3a0c69
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2021-11-01 17:02:02 +01:00
parent 4dac32d661
commit 195abefe7d
56 changed files with 149 additions and 126 deletions

View File

@@ -141,8 +141,8 @@ void ClangCurrentDocumentFilter::accept(Core::LocatorFilterEntry selection,
if (!m_currentEditor)
return;
auto lineColumn = qvariant_cast<LineColumn>(selection.internalData);
Core::EditorManager::openEditorAt(m_currentPath, lineColumn.line,
lineColumn.column - 1);
Core::EditorManager::openEditorAt(
{FilePath::fromString(m_currentPath), lineColumn.line, lineColumn.column - 1});
}
void ClangCurrentDocumentFilter::reset(Core::IEditor *newCurrent, const QString &path)

View File

@@ -74,9 +74,9 @@ void openEditorAt(const ClangBackEnd::DiagnosticContainer &diagnostic)
{
const ClangBackEnd::SourceLocationContainer &location = diagnostic.location;
Core::EditorManager::openEditorAt(location.filePath.toString(),
int(location.line),
int(location.column - 1));
Core::EditorManager::openEditorAt({Utils::FilePath::fromString(location.filePath.toString()),
int(location.line),
int(location.column - 1)});
}
void applyFixit(const ClangBackEnd::DiagnosticContainer &diagnostic)

View File

@@ -323,7 +323,8 @@ bool OpenDocumentCommand::run()
{
qCDebug(debug) << "line" << context().lineNumber << "OpenDocumentCommand" << m_documentFilePath;
const bool openEditorSucceeded = Core::EditorManager::openEditor(m_documentFilePath);
const bool openEditorSucceeded = Core::EditorManager::openEditor(
Utils::FilePath::fromString(m_documentFilePath));
QTC_ASSERT(openEditorSucceeded, return false);
auto *processor = ClangEditorDocumentProcessor::get(m_documentFilePath);

View File

@@ -181,7 +181,8 @@ private:
OpenEditorAtCursorPosition::OpenEditorAtCursorPosition(const TestDocument &testDocument)
{
Core::IEditor *coreEditor = Core::EditorManager::openEditor(testDocument.filePath);
Core::IEditor *coreEditor = Core::EditorManager::openEditor(
Utils::FilePath::fromString(testDocument.filePath));
m_editor = qobject_cast<TextEditor::BaseTextEditor *>(coreEditor);
QTC_CHECK(m_editor);
if (m_editor) {

View File

@@ -1852,7 +1852,7 @@ void ClangdTestCompletion::getProposal(const QString &fileName,
int line, column;
Utils::Text::convertPosition(doc->document(), pos, &line, &column);
const auto editor = qobject_cast<BaseTextEditor *>(
EditorManager::openEditorAt(doc->filePath().toString(), line, column - 1));
EditorManager::openEditorAt({doc->filePath(), line, column - 1}));
QVERIFY(editor);
QCOMPARE(EditorManager::currentEditor(), editor);
QCOMPARE(editor->textDocument(), doc);