ClassView: Proliferate FilePath use

Change-Id: I4a8a18d6045557e31571970d671f3cc3f4374493
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2022-11-24 15:28:39 +01:00
parent 2119dd4397
commit 7b08e79913
6 changed files with 31 additions and 35 deletions

View File

@@ -19,8 +19,7 @@ using namespace Core;
using namespace ProjectExplorer;
using namespace Utils;
namespace ClassView {
namespace Internal {
namespace ClassView::Internal {
///////////////////////////////// ManagerPrivate //////////////////////////////////
@@ -347,9 +346,9 @@ void Manager::onWidgetVisibilityIsChanged(bool visibility)
\a column (0-based).
*/
void Manager::gotoLocation(const QString &fileName, int line, int column)
void Manager::gotoLocation(const FilePath &filePath, int line, int column)
{
EditorManager::openEditorAt({FilePath::fromString(fileName), line, column});
EditorManager::openEditorAt({filePath, line, column});
}
/*!
@@ -372,11 +371,11 @@ void Manager::gotoLocations(const QList<QVariant> &list)
auto textEditor = qobject_cast<TextEditor::BaseTextEditor *>(EditorManager::currentEditor());
if (textEditor) {
// check if current cursor position is a known location of the symbol
const QString fileName = textEditor->document()->filePath().toString();
const FilePath filePath = textEditor->document()->filePath();
int line;
int column;
textEditor->convertPosition(textEditor->position(), &line, &column);
const SymbolLocation current(fileName, line, column);
const SymbolLocation current(filePath, line, column);
if (auto it = locations.constFind(current), end = locations.constEnd(); it != end) {
// we already are at the symbol, cycle to next location
++it;
@@ -388,7 +387,7 @@ void Manager::gotoLocations(const QList<QVariant> &list)
}
const SymbolLocation &location = *locationIt;
// line is 1-based, column is 0-based
gotoLocation(location.fileName(), location.line(), location.column() - 1);
gotoLocation(location.filePath(), location.line(), location.column() - 1);
}
/*!
@@ -402,5 +401,4 @@ void Manager::setFlatMode(bool flat)
}, Qt::QueuedConnection);
}
} // namespace Internal
} // namespace ClassView
} // ClassView::Internal