From 5aa3e6655cb11ed244fc4b4fcfc54981c47f18fb Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Fri, 30 Jun 2023 18:42:11 +0200 Subject: [PATCH] IosRunner: Do some cleanup Move some public methods into private section. Remove unused / no-op functions. Make some functions const. Change-Id: Iffcac68aef12db939bfc60b3a01272cf07c67c89 Reviewed-by: Reviewed-by: Eike Ziller Reviewed-by: Alessandro Portale --- src/plugins/ios/iosrunner.cpp | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/src/plugins/ios/iosrunner.cpp b/src/plugins/ios/iosrunner.cpp index 9b1f2d04869..8237a19c43a 100644 --- a/src/plugins/ios/iosrunner.cpp +++ b/src/plugins/ios/iosrunner.cpp @@ -81,26 +81,21 @@ public: void setCppDebugging(bool cppDebug); void setQmlDebugging(QmlDebug::QmlDebugServicesPreset qmlDebugServices); - Utils::FilePath bundlePath() const; - QString deviceId(); - IosToolHandler::RunKind runType(); - bool cppDebug() const; - bool qmlDebug() const; - QmlDebug::QmlDebugServicesPreset qmlDebugServices() const; - void start() override; void stop() final; - virtual void appOutput(const QString &/*output*/) {} - virtual void errorMsg(const QString &/*msg*/) {} - virtual void onStart() { reportStarted(); } - Port qmlServerPort() const; Port gdbServerPort() const; qint64 pid() const; bool isAppRunning() const; private: + Utils::FilePath bundlePath() const; + QString deviceId() const; + IosToolHandler::RunKind runType() const; + bool cppDebug() const; + bool qmlDebug() const; + void handleGotServerPorts(Ios::IosToolHandler *handler, const FilePath &bundlePath, const QString &deviceId, Port gdbPort, Port qmlPort); void handleGotInferiorPid(Ios::IosToolHandler *handler, const FilePath &bundlePath, @@ -155,7 +150,7 @@ FilePath IosRunner::bundlePath() const return m_bundleDir; } -QString IosRunner::deviceId() +QString IosRunner::deviceId() const { IosDevice::ConstPtr dev = m_device.dynamicCast(); if (!dev) @@ -163,7 +158,7 @@ QString IosRunner::deviceId() return dev->uniqueDeviceID(); } -IosToolHandler::RunKind IosRunner::runType() +IosToolHandler::RunKind IosRunner::runType() const { if (m_cppDebug) return IosToolHandler::DebugRun; @@ -180,11 +175,6 @@ bool IosRunner::qmlDebug() const return m_qmlDebugServices != QmlDebug::NoQmlDebugServices; } -QmlDebug::QmlDebugServicesPreset IosRunner::qmlDebugServices() const -{ - return m_qmlDebugServices; -} - void IosRunner::start() { if (m_toolHandler && isAppRunning()) @@ -315,7 +305,6 @@ void IosRunner::handleAppOutput(IosToolHandler *handler, const QString &output) if (match.hasMatch() && m_qmlServerPort.isValid()) res.replace(match.captured(1), QString::number(m_qmlServerPort.number())); appendMessage(output, StdOutFormat); - appOutput(res); } void IosRunner::handleErrorMsg(IosToolHandler *handler, const QString &msg) @@ -337,7 +326,6 @@ void IosRunner::handleErrorMsg(IosToolHandler *handler, const QString &msg) res.replace(match.captured(1), QString::number(m_qmlServerPort.number())); appendMessage(res, StdErrFormat); - errorMsg(res); } void IosRunner::handleToolExited(IosToolHandler *handler, int code) @@ -389,8 +377,6 @@ public: explicit IosRunSupport(RunControl *runControl); ~IosRunSupport() override; - void didStartApp(IosToolHandler::OpStatus status); - private: void start() override; }; @@ -400,8 +386,8 @@ IosRunSupport::IosRunSupport(RunControl *runControl) { setId("IosRunSupport"); runControl->setIcon(Icons::RUN_SMALL_TOOLBAR); - QString displayName = QString("Run on %1").arg(device().isNull() ? QString() : device()->displayName()); - runControl->setDisplayName(displayName); + runControl->setDisplayName(QString("Run on %1") + .arg(device().isNull() ? QString() : device()->displayName())); } IosRunSupport::~IosRunSupport()