aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/qml/qmlengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/debugger/qml/qmlengine.cpp')
-rw-r--r--src/plugins/debugger/qml/qmlengine.cpp32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp
index 204d6c4437c..033069c1165 100644
--- a/src/plugins/debugger/qml/qmlengine.cpp
+++ b/src/plugins/debugger/qml/qmlengine.cpp
@@ -40,8 +40,8 @@
#include <utils/basetreeview.h>
#include <utils/fileinprojectfinder.h>
+#include <utils/process.h>
#include <utils/qtcassert.h>
-#include <utils/qtcprocess.h>
#include <utils/treemodel.h>
#include <QDebug>
@@ -200,7 +200,7 @@ public:
QHash<QString, QTextDocument*> sourceDocuments;
InteractiveInterpreter interpreter;
- QtcProcess process;
+ Process process;
QmlInspectorAgent inspectorAgent;
QList<quint32> queryIds;
@@ -249,17 +249,17 @@ QmlEngine::QmlEngine()
connect(stackHandler(), &StackHandler::currentIndexChanged,
this, &QmlEngine::updateCurrentContext);
- connect(&d->process, &QtcProcess::readyReadStandardOutput, this, [this] {
+ connect(&d->process, &Process::readyReadStandardOutput, this, [this] {
// FIXME: Redirect to RunControl
showMessage(d->process.readAllStandardOutput(), AppOutput);
});
- connect(&d->process, &QtcProcess::readyReadStandardError, this, [this] {
+ connect(&d->process, &Process::readyReadStandardError, this, [this] {
// FIXME: Redirect to RunControl
showMessage(d->process.readAllStandardError(), AppOutput);
});
- connect(&d->process, &QtcProcess::done, this, &QmlEngine::disconnected);
- connect(&d->process, &QtcProcess::started, this, &QmlEngine::handleLauncherStarted);
+ connect(&d->process, &Process::done, this, &QmlEngine::disconnected);
+ connect(&d->process, &Process::started, this, &QmlEngine::handleLauncherStarted);
debuggerConsole()->populateFileFinder();
debuggerConsole()->setScriptEvaluator([this](const QString &expr) {
@@ -736,7 +736,7 @@ bool QmlEngine::acceptsBreakpoint(const BreakpointParameters &bp) const
return bp.isQmlFileAndLineBreakpoint();
}
-void QmlEngine::loadSymbols(const QString &moduleName)
+void QmlEngine::loadSymbols(const FilePath &moduleName)
{
Q_UNUSED(moduleName)
}
@@ -759,7 +759,7 @@ void QmlEngine::updateAll()
d->updateLocals();
}
-void QmlEngine::requestModuleSymbols(const QString &moduleName)
+void QmlEngine::requestModuleSymbols(const FilePath &moduleName)
{
Q_UNUSED(moduleName)
}
@@ -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;
@@ -2321,7 +2320,6 @@ void QmlEnginePrivate::insertSubItems(WatchItem *parent, const QVariantList &pro
QTC_ASSERT(parent, return);
LookupItems itemsToLookup;
- const QSet<QString> expandedINames = engine->watchHandler()->expandedINames();
for (const QVariant &property : properties) {
QmlV8ObjectData propertyData = extractData(property);
std::unique_ptr<WatchItem> item(new WatchItem);
@@ -2343,7 +2341,7 @@ void QmlEnginePrivate::insertSubItems(WatchItem *parent, const QVariantList &pro
item->id = propertyData.handle;
item->type = propertyData.type;
item->value = propertyData.value.toString();
- if (item->type.isEmpty() || expandedINames.contains(item->iname))
+ if (item->type.isEmpty() || engine->watchHandler()->isExpandedIName(item->iname))
itemsToLookup.insert(propertyData.handle, {item->iname, item->name, item->exp});
setWatchItemHasChildren(item.get(), propertyData.hasChildren());
parent->appendChild(item.release());
@@ -2445,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();
@@ -2454,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()