forked from qt-creator/qt-creator
Debugger: Move toFileInProject to QmlEngine
The only user. Change-Id: I443cbfab20739fb43a45848355110f879b0f3041 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -74,7 +74,6 @@
|
||||
#include <texteditor/fontsettings.h>
|
||||
|
||||
#include <utils/basetreeview.h>
|
||||
#include <utils/fileinprojectfinder.h>
|
||||
#include <utils/macroexpander.h>
|
||||
#include <utils/processhandle.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -485,7 +484,6 @@ public:
|
||||
QScopedPointer<LocationMark> m_locationMark;
|
||||
QTimer m_locationTimer;
|
||||
|
||||
Utils::FileInProjectFinder m_fileFinder;
|
||||
QString m_qtNamespace;
|
||||
|
||||
// Safety net to avoid infinite lookups.
|
||||
@@ -1864,18 +1862,6 @@ bool DebuggerEngine::canDisplayTooltip() const
|
||||
return state() == InferiorStopOk;
|
||||
}
|
||||
|
||||
QString DebuggerEngine::toFileInProject(const QUrl &fileUrl)
|
||||
{
|
||||
// make sure file finder is properly initialized
|
||||
const DebuggerRunParameters &rp = runParameters();
|
||||
d->m_fileFinder.setProjectDirectory(rp.projectSourceDirectory);
|
||||
d->m_fileFinder.setProjectFiles(rp.projectSourceFiles);
|
||||
d->m_fileFinder.setAdditionalSearchDirectories(rp.additionalSearchDirectories);
|
||||
d->m_fileFinder.setSysroot(rp.sysRoot);
|
||||
|
||||
return d->m_fileFinder.findFile(fileUrl).first().toString();
|
||||
}
|
||||
|
||||
QString DebuggerEngine::expand(const QString &string) const
|
||||
{
|
||||
return runParameters().macroExpander->expand(string);
|
||||
|
||||
@@ -405,8 +405,6 @@ public:
|
||||
|
||||
virtual bool canDisplayTooltip() const;
|
||||
|
||||
QString toFileInProject(const QUrl &fileUrl);
|
||||
|
||||
QString expand(const QString &string) const;
|
||||
QString nativeStartupCommands() const;
|
||||
Utils::Perspective *perspective() const;
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
#include <app/app_version.h>
|
||||
#include <utils/treemodel.h>
|
||||
#include <utils/basetreeview.h>
|
||||
#include <utils/fileinprojectfinder.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QDebug>
|
||||
@@ -234,6 +235,8 @@ public:
|
||||
|
||||
QHash<int, QmlCallback> callbackForToken;
|
||||
|
||||
FileInProjectFinder fileFinder;
|
||||
|
||||
private:
|
||||
ConsoleItem *constructLogItemTree(const QmlV8ObjectData &objectData, QList<int> &seenHandles);
|
||||
void constructChildLogItems(ConsoleItem *item, const QmlV8ObjectData &objectData,
|
||||
@@ -2434,6 +2437,18 @@ void QmlEnginePrivate::flushSendBuffer()
|
||||
sendBuffer.clear();
|
||||
}
|
||||
|
||||
QString QmlEngine::toFileInProject(const QUrl &fileUrl)
|
||||
{
|
||||
// make sure file finder is properly initialized
|
||||
const DebuggerRunParameters &rp = runParameters();
|
||||
d->fileFinder.setProjectDirectory(rp.projectSourceDirectory);
|
||||
d->fileFinder.setProjectFiles(rp.projectSourceFiles);
|
||||
d->fileFinder.setAdditionalSearchDirectories(rp.additionalSearchDirectories);
|
||||
d->fileFinder.setSysroot(rp.sysRoot);
|
||||
|
||||
return d->fileFinder.findFile(fileUrl).first().toString();
|
||||
}
|
||||
|
||||
DebuggerEngine *createQmlEngine()
|
||||
{
|
||||
return new QmlEngine;
|
||||
|
||||
@@ -50,6 +50,7 @@ public:
|
||||
void logServiceActivity(const QString &service, const QString &logMessage);
|
||||
|
||||
void expressionEvaluated(quint32 queryId, const QVariant &result);
|
||||
QString toFileInProject(const QUrl &fileUrl);
|
||||
|
||||
private:
|
||||
void disconnected();
|
||||
|
||||
Reference in New Issue
Block a user