forked from qt-creator/qt-creator
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: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -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<const IosDevice>();
|
||||
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()
|
||||
|
Reference in New Issue
Block a user