ProjectExplorer: Avoid use of Runnable::device

Derive it from the command's filepath instead.

Change-Id: Icb37bc0cbf449459902f24e53df9f81473e97b7b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2022-05-25 11:18:25 +02:00
parent 1a81551b9d
commit 8badc4669e

View File

@@ -30,6 +30,7 @@
#include "buildsystem.h"
#include "compileoutputwindow.h"
#include "deployconfiguration.h"
#include "devicesupport/devicemanager.h"
#include "kit.h"
#include "kitinformation.h"
#include "project.h"
@@ -46,8 +47,9 @@
#include <coreplugin/icore.h>
#include <coreplugin/progressmanager/futureprogress.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/devicesupport/idevice.h>
#include <utils/algorithm.h>
#include <utils/outputformatter.h>
#include <utils/runextensions.h>
@@ -118,7 +120,8 @@ static int queue(const QList<Project *> &projects, const QList<Id> &stepIds,
return projects.contains(rc->project());
case StopBeforeBuild::SameBuildDir:
return Utils::contains(projects, [rc, configSelection](Project *p) {
IDevice::ConstPtr device = rc->runnable().device;
const FilePath executable = rc->runnable().command.executable();
IDevice::ConstPtr device = DeviceManager::deviceForPath(executable);
for (const Target * const t : targetsForSelection(p, configSelection)) {
if (device.isNull())
device = DeviceKitAspect::device(t->kit());
@@ -126,7 +129,7 @@ static int queue(const QList<Project *> &projects, const QList<Id> &stepIds,
continue;
for (const BuildConfiguration * const bc
: buildConfigsForSelection(t, configSelection)) {
if (rc->runnable().command.executable().isChildOf(bc->buildDirectory()))
if (executable.isChildOf(bc->buildDirectory()))
return true;
}
}