Debugger: Transform DebuggerRunParameters::additionalSearchDirectories

Task-number: QTCREATORBUG-29168
Change-Id: I55dbf5ea72109f3fe0150ac19733e41d2450440c
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2025-01-10 13:45:18 +01:00
parent 17579bf93e
commit 17ace97d64
7 changed files with 8 additions and 11 deletions

View File

@@ -152,7 +152,7 @@ public:
<< runControl->qmlChannel().toDisplayString(); << runControl->qmlChannel().toDisplayString();
//TODO: Not sure if these are the right paths. //TODO: Not sure if these are the right paths.
if (qtVersion) if (qtVersion)
addSearchDirectory(qtVersion->qmlPath()); rp.addSearchDirectory(qtVersion->qmlPath());
} }
connect(this, &RunWorker::started, this, [this, packageName] { connect(this, &RunWorker::started, this, [this, packageName] {
qCDebug(androidDebugSupportLog) << "Starting debugger - package name: " << packageName qCDebug(androidDebugSupportLog) << "Starting debugger - package name: " << packageName

View File

@@ -2919,7 +2919,7 @@ QString DebuggerEngine::formatStartParameters() const
if (!sp.projectSourceDirectory.isEmpty()) { if (!sp.projectSourceDirectory.isEmpty()) {
str << "Project: " << sp.projectSourceDirectory.toUserOutput() << '\n'; str << "Project: " << sp.projectSourceDirectory.toUserOutput() << '\n';
str << "Additional Search Directories:"; str << "Additional Search Directories:";
for (const FilePath &dir : sp.additionalSearchDirectories) for (const FilePath &dir : sp.additionalSearchDirectories())
str << ' ' << dir; str << ' ' << dir;
str << '\n'; str << '\n';
} }

View File

@@ -147,7 +147,8 @@ public:
void setUseTargetAsync(bool on) { m_useTargetAsync = on; } void setUseTargetAsync(bool on) { m_useTargetAsync = on; }
bool useTargetAsync() const { return m_useTargetAsync; } bool useTargetAsync() const { return m_useTargetAsync; }
Utils::FilePaths additionalSearchDirectories; void addSearchDirectory(const Utils::FilePath &dir) { m_additionalSearchDirectories.append(dir); }
Utils::FilePaths additionalSearchDirectories() const { return m_additionalSearchDirectories; }
// Used by iOS. // Used by iOS.
QString platform; QString platform;
@@ -250,6 +251,8 @@ private:
bool m_useCtrlCStub = false; // For QNX debugging. bool m_useCtrlCStub = false; // For QNX debugging.
bool m_useTargetAsync = false; bool m_useTargetAsync = false;
Utils::FilePaths m_additionalSearchDirectories;
}; };
namespace Internal { namespace Internal {

View File

@@ -189,11 +189,6 @@ void DebuggerRunTool::setCrashParameter(const QString &event)
m_runParameters.crashParameter = event; m_runParameters.crashParameter = event;
} }
void DebuggerRunTool::addSearchDirectory(const Utils::FilePath &dir)
{
m_runParameters.additionalSearchDirectories.append(dir);
}
void DebuggerRunTool::start() void DebuggerRunTool::start()
{ {
startCoreFileSetupIfNeededAndContinueStartup(); startCoreFileSetupIfNeededAndContinueStartup();

View File

@@ -62,7 +62,6 @@ public:
void setUsePortsGatherer(bool useCpp, bool useQml); void setUsePortsGatherer(bool useCpp, bool useQml);
void modifyDebuggerEnvironment(const Utils::EnvironmentItems &item); void modifyDebuggerEnvironment(const Utils::EnvironmentItems &item);
void addSearchDirectory(const Utils::FilePath &dir);
void setIosPlatform(const QString &platform); void setIosPlatform(const QString &platform);
void setDeviceSymbolsRoot(const QString &deviceSymbolsRoot); void setDeviceSymbolsRoot(const QString &deviceSymbolsRoot);

View File

@@ -2451,7 +2451,7 @@ FilePath QmlEngine::toFileInProject(const QUrl &fileUrl)
const DebuggerRunParameters &rp = runParameters(); const DebuggerRunParameters &rp = runParameters();
d->fileFinder.setProjectDirectory(rp.projectSourceDirectory); d->fileFinder.setProjectDirectory(rp.projectSourceDirectory);
d->fileFinder.setProjectFiles(rp.projectSourceFiles); d->fileFinder.setProjectFiles(rp.projectSourceFiles);
d->fileFinder.setAdditionalSearchDirectories(rp.additionalSearchDirectories); d->fileFinder.setAdditionalSearchDirectories(rp.additionalSearchDirectories());
d->fileFinder.setSysroot(rp.sysRoot); d->fileFinder.setSysroot(rp.sysRoot);
return d->fileFinder.findFile(fileUrl).constFirst(); return d->fileFinder.findFile(fileUrl).constFirst();

View File

@@ -169,7 +169,7 @@ private:
QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(runControl()->kit()); QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(runControl()->kit());
if (version) { if (version) {
rp.setSolibSearchPath(version->qtSoPaths()); rp.setSolibSearchPath(version->qtSoPaths());
addSearchDirectory(version->qmlPath()); rp.addSearchDirectory(version->qmlPath());
} }
auto sysroot = SysRootKitAspect().sysRoot(runControl()->kit()); auto sysroot = SysRootKitAspect().sysRoot(runControl()->kit());