Debugger: filepathify DiagnosticLocation

Change-Id: Ibbbf137231b313ec10e3d57c0230217b0c1e0a6c
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
David Schulz
2021-05-28 12:37:35 +02:00
parent 27f8e2dbce
commit 0cfe27a53d
19 changed files with 78 additions and 70 deletions

View File

@@ -79,7 +79,7 @@ QVariant DiagnosticItem::data(int column, int role) const
if (column == DiagnosticsModel::DiagnosticColumn) {
switch (role) {
case DetailedErrorView::LocationRole: {
const auto location = DiagnosticLocation(m_diagnostic.fileName.toString(),
const auto location = DiagnosticLocation(m_diagnostic.fileName,
m_diagnostic.lineNumber,
0);
return QVariant::fromValue(location);
@@ -92,7 +92,7 @@ QVariant DiagnosticItem::data(int column, int role) const
return getIcon(m_diagnostic.severity);
case Debugger::DetailedErrorView::FullTextRole:
return QString("%1:%2: %3")
.arg(m_diagnostic.fileName.toString())
.arg(m_diagnostic.fileName.toUserOutput())
.arg(m_diagnostic.lineNumber)
.arg(m_diagnostic.message);
default:

View File

@@ -103,7 +103,7 @@ void DiagnosticView::openEditorForCurrentIndex()
const QVariant v = model()->data(currentIndex(), Debugger::DetailedErrorView::LocationRole);
const auto loc = v.value<Debugger::DiagnosticLocation>();
if (loc.isValid())
Core::EditorManager::openEditorAt(loc.filePath, loc.line, loc.column - 1);
Core::EditorManager::openEditorAt(Utils::Link(loc.filePath, loc.line, loc.column - 1));
}
void DiagnosticView::mouseDoubleClickEvent(QMouseEvent *event)