summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/qml/qmlengine.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2023-03-14 18:18:39 +0100
committerhjk <hjk@qt.io>2023-03-15 12:34:58 +0000
commit0dc61f55c3919765ae0fd453de2719daeb4f0718 (patch)
tree79d183e86d69def224de407b1c0c431a94432e8c /src/plugins/debugger/qml/qmlengine.cpp
parent47ed25e95dd1e7a5c0ac937785e7127dd7592cd0 (diff)
downloadqt-creator-0dc61f55c3919765ae0fd453de2719daeb4f0718.tar.gz
Debugger: Use more FilePath in source file handling
Needed for the double-remote case. With this we have proper breakpoint markers in the text editor for a remotely running gdb on a remotely loaded project. Change-Id: If80e4a4108a4a0bcdd7612a59e2bd695213f5ea5 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/debugger/qml/qmlengine.cpp')
-rw-r--r--src/plugins/debugger/qml/qmlengine.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp
index eb1ebc939a..0730caaf78 100644
--- a/src/plugins/debugger/qml/qmlengine.cpp
+++ b/src/plugins/debugger/qml/qmlengine.cpp
@@ -1802,10 +1802,10 @@ void QmlEnginePrivate::messageReceived(const QByteArray &data)
updateScriptSource(name, lineOffset, columnOffset, source);
}
- QMap<QString,QString> files;
+ QMap<QString, FilePath> files;
for (const QString &file : std::as_const(sourceFiles)) {
QString shortName = file;
- QString fullName = engine->toFileInProject(file);
+ FilePath fullName = engine->toFileInProject(file);
files.insert(shortName, fullName);
}
@@ -1915,7 +1915,7 @@ void QmlEnginePrivate::messageReceived(const QByteArray &data)
const QVariantMap script = body.value("script").toMap();
QUrl fileUrl(script.value(NAME).toString());
- QString filePath = engine->toFileInProject(fileUrl);
+ FilePath filePath = engine->toFileInProject(fileUrl);
const QVariantMap exception = body.value("exception").toMap();
QString errorMessage = exception.value("text").toString();
@@ -2045,8 +2045,7 @@ StackFrame QmlEnginePrivate::extractStackFrame(const QVariant &bodyVal)
stackFrame.function = extractString(body.value("func"));
if (stackFrame.function.isEmpty())
stackFrame.function = Tr::tr("Anonymous Function");
- stackFrame.file = FilePath::fromString(
- engine->toFileInProject(extractString(body.value("script"))));
+ stackFrame.file = engine->toFileInProject(extractString(body.value("script")));
stackFrame.usable = stackFrame.file.isReadableFile();
stackFrame.receiver = extractString(body.value("receiver"));
stackFrame.line = body.value("line").toInt() + 1;
@@ -2444,7 +2443,7 @@ void QmlEnginePrivate::flushSendBuffer()
sendBuffer.clear();
}
-QString QmlEngine::toFileInProject(const QUrl &fileUrl)
+FilePath QmlEngine::toFileInProject(const QUrl &fileUrl)
{
// make sure file finder is properly initialized
const DebuggerRunParameters &rp = runParameters();
@@ -2453,7 +2452,7 @@ QString QmlEngine::toFileInProject(const QUrl &fileUrl)
d->fileFinder.setAdditionalSearchDirectories(rp.additionalSearchDirectories);
d->fileFinder.setSysroot(rp.sysRoot);
- return d->fileFinder.findFile(fileUrl).constFirst().toString();
+ return d->fileFinder.findFile(fileUrl).constFirst();
}
DebuggerEngine *createQmlEngine()