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 setCppDebugging(bool cppDebug);
|
||||||
void setQmlDebugging(QmlDebug::QmlDebugServicesPreset qmlDebugServices);
|
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 start() override;
|
||||||
void stop() final;
|
void stop() final;
|
||||||
|
|
||||||
virtual void appOutput(const QString &/*output*/) {}
|
|
||||||
virtual void errorMsg(const QString &/*msg*/) {}
|
|
||||||
virtual void onStart() { reportStarted(); }
|
|
||||||
|
|
||||||
Port qmlServerPort() const;
|
Port qmlServerPort() const;
|
||||||
Port gdbServerPort() const;
|
Port gdbServerPort() const;
|
||||||
qint64 pid() const;
|
qint64 pid() const;
|
||||||
bool isAppRunning() const;
|
bool isAppRunning() const;
|
||||||
|
|
||||||
private:
|
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,
|
void handleGotServerPorts(Ios::IosToolHandler *handler, const FilePath &bundlePath,
|
||||||
const QString &deviceId, Port gdbPort, Port qmlPort);
|
const QString &deviceId, Port gdbPort, Port qmlPort);
|
||||||
void handleGotInferiorPid(Ios::IosToolHandler *handler, const FilePath &bundlePath,
|
void handleGotInferiorPid(Ios::IosToolHandler *handler, const FilePath &bundlePath,
|
||||||
@@ -155,7 +150,7 @@ FilePath IosRunner::bundlePath() const
|
|||||||
return m_bundleDir;
|
return m_bundleDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IosRunner::deviceId()
|
QString IosRunner::deviceId() const
|
||||||
{
|
{
|
||||||
IosDevice::ConstPtr dev = m_device.dynamicCast<const IosDevice>();
|
IosDevice::ConstPtr dev = m_device.dynamicCast<const IosDevice>();
|
||||||
if (!dev)
|
if (!dev)
|
||||||
@@ -163,7 +158,7 @@ QString IosRunner::deviceId()
|
|||||||
return dev->uniqueDeviceID();
|
return dev->uniqueDeviceID();
|
||||||
}
|
}
|
||||||
|
|
||||||
IosToolHandler::RunKind IosRunner::runType()
|
IosToolHandler::RunKind IosRunner::runType() const
|
||||||
{
|
{
|
||||||
if (m_cppDebug)
|
if (m_cppDebug)
|
||||||
return IosToolHandler::DebugRun;
|
return IosToolHandler::DebugRun;
|
||||||
@@ -180,11 +175,6 @@ bool IosRunner::qmlDebug() const
|
|||||||
return m_qmlDebugServices != QmlDebug::NoQmlDebugServices;
|
return m_qmlDebugServices != QmlDebug::NoQmlDebugServices;
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlDebug::QmlDebugServicesPreset IosRunner::qmlDebugServices() const
|
|
||||||
{
|
|
||||||
return m_qmlDebugServices;
|
|
||||||
}
|
|
||||||
|
|
||||||
void IosRunner::start()
|
void IosRunner::start()
|
||||||
{
|
{
|
||||||
if (m_toolHandler && isAppRunning())
|
if (m_toolHandler && isAppRunning())
|
||||||
@@ -315,7 +305,6 @@ void IosRunner::handleAppOutput(IosToolHandler *handler, const QString &output)
|
|||||||
if (match.hasMatch() && m_qmlServerPort.isValid())
|
if (match.hasMatch() && m_qmlServerPort.isValid())
|
||||||
res.replace(match.captured(1), QString::number(m_qmlServerPort.number()));
|
res.replace(match.captured(1), QString::number(m_qmlServerPort.number()));
|
||||||
appendMessage(output, StdOutFormat);
|
appendMessage(output, StdOutFormat);
|
||||||
appOutput(res);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosRunner::handleErrorMsg(IosToolHandler *handler, const QString &msg)
|
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()));
|
res.replace(match.captured(1), QString::number(m_qmlServerPort.number()));
|
||||||
|
|
||||||
appendMessage(res, StdErrFormat);
|
appendMessage(res, StdErrFormat);
|
||||||
errorMsg(res);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosRunner::handleToolExited(IosToolHandler *handler, int code)
|
void IosRunner::handleToolExited(IosToolHandler *handler, int code)
|
||||||
@@ -389,8 +377,6 @@ public:
|
|||||||
explicit IosRunSupport(RunControl *runControl);
|
explicit IosRunSupport(RunControl *runControl);
|
||||||
~IosRunSupport() override;
|
~IosRunSupport() override;
|
||||||
|
|
||||||
void didStartApp(IosToolHandler::OpStatus status);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void start() override;
|
void start() override;
|
||||||
};
|
};
|
||||||
@@ -400,8 +386,8 @@ IosRunSupport::IosRunSupport(RunControl *runControl)
|
|||||||
{
|
{
|
||||||
setId("IosRunSupport");
|
setId("IosRunSupport");
|
||||||
runControl->setIcon(Icons::RUN_SMALL_TOOLBAR);
|
runControl->setIcon(Icons::RUN_SMALL_TOOLBAR);
|
||||||
QString displayName = QString("Run on %1").arg(device().isNull() ? QString() : device()->displayName());
|
runControl->setDisplayName(QString("Run on %1")
|
||||||
runControl->setDisplayName(displayName);
|
.arg(device().isNull() ? QString() : device()->displayName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
IosRunSupport::~IosRunSupport()
|
IosRunSupport::~IosRunSupport()
|
||||||
|
Reference in New Issue
Block a user