RunWorker: Get rid of setSupportsReRunning()

Use RunControl::setSupportReRunning() instead.

Change-Id: I7cfcf9cb3542756ab3d990a22b6224f390b7eed9
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2025-01-14 16:47:28 +01:00
parent d915c447d4
commit 2a16fac8b6
5 changed files with 4 additions and 29 deletions

View File

@@ -238,7 +238,7 @@ void DebuggerRunTool::continueAfterTerminalStart()
// QML and/or mixed are not prepared for it. // QML and/or mixed are not prepared for it.
// setSupportsReRunning(!m_runParameters.isQmlDebugging); // setSupportsReRunning(!m_runParameters.isQmlDebugging);
setSupportsReRunning(false); // FIXME: Broken in general. runControl()->setSupportsReRunning(false); // FIXME: Broken in general.
// FIXME: Disabled due to Android. Make Android device report available ports instead. // FIXME: Disabled due to Android. Make Android device report available ports instead.
// int portsUsed = portsUsedByDebugger(); // int portsUsed = portsUsedByDebugger();

View File

@@ -233,7 +233,6 @@ public:
QList<RunWorker *> stopDependencies; QList<RunWorker *> stopDependencies;
QString id; QString id;
bool supportsReRunning = true;
bool essential = false; bool essential = false;
}; };
@@ -350,7 +349,6 @@ public:
void showError(const QString &msg); void showError(const QString &msg);
static bool isAllowedTransition(RunControlState from, RunControlState to); static bool isAllowedTransition(RunControlState from, RunControlState to);
bool supportsReRunning() const;
bool isUsingTaskTree() const { return bool(m_runRecipe); } bool isUsingTaskTree() const { return bool(m_runRecipe); }
void startTaskTree(); void startTaskTree();
void checkAutoDeleteAndEmitStopped(); void checkAutoDeleteAndEmitStopped();
@@ -1211,24 +1209,7 @@ void RunControl::setSupportsReRunning(bool reRunningSupported)
bool RunControl::supportsReRunning() const bool RunControl::supportsReRunning() const
{ {
if (d->isUsingTaskTree())
return d->m_supportsReRunning; return d->m_supportsReRunning;
return d->supportsReRunning();
}
bool RunControlPrivate::supportsReRunning() const
{
for (RunWorker *worker : m_workers) {
if (!worker) {
debugMessage("Found unknown deleted worker when checking for re-run support");
return false;
}
if (!worker->d->supportsReRunning)
return false;
if (worker->d->state != RunWorkerState::Done)
return false;
}
return true;
} }
void RunControlPrivate::startTaskTree() void RunControlPrivate::startTaskTree()
@@ -1902,11 +1883,6 @@ void RunWorker::setId(const QString &id)
d->id = id; d->id = id;
} }
void RunWorker::setSupportsReRunning(bool reRunningSupported)
{
d->supportsReRunning = reRunningSupported;
}
QString RunWorker::userMessageForProcessError(QProcess::ProcessError error, const FilePath &program) QString RunWorker::userMessageForProcessError(QProcess::ProcessError error, const FilePath &program)
{ {
QString failedToStart = Tr::tr("The process failed to start."); QString failedToStart = Tr::tr("The process failed to start.");

View File

@@ -69,7 +69,6 @@ public:
void reportDone(); void reportDone();
void reportFailure(const QString &msg = QString()); void reportFailure(const QString &msg = QString());
void setSupportsReRunning(bool reRunningSupported);
static QString userMessageForProcessError(QProcess::ProcessError, static QString userMessageForProcessError(QProcess::ProcessError,
const Utils::FilePath &programName); const Utils::FilePath &programName);

View File

@@ -40,7 +40,7 @@ QmlProfilerRunner::QmlProfilerRunner(RunControl *runControl)
setId("QmlProfilerRunner"); setId("QmlProfilerRunner");
runControl->requestQmlChannel(); runControl->requestQmlChannel();
runControl->setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL_TOOLBAR); runControl->setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL_TOOLBAR);
setSupportsReRunning(false); runControl->setSupportsReRunning(false);
} }
void QmlProfilerRunner::start() void QmlProfilerRunner::start()

View File

@@ -29,7 +29,7 @@ ValgrindToolRunner::ValgrindToolRunner(RunControl *runControl)
: RunWorker(runControl) : RunWorker(runControl)
{ {
runControl->setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL_TOOLBAR); runControl->setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL_TOOLBAR);
setSupportsReRunning(false); runControl->setSupportsReRunning(false);
m_settings.fromMap(runControl->settingsData(ANALYZER_VALGRIND_SETTINGS)); m_settings.fromMap(runControl->settingsData(ANALYZER_VALGRIND_SETTINGS));