Commit 26b54747 authored by hjk's avatar hjk

RunControl: Make icon(path) a value member

Change-Id: I7f7099d03a25a14d8df02273cca928e9f1fbfe1d
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent fb494b73
......@@ -50,6 +50,8 @@ AnalyzerRunControl::AnalyzerRunControl(const AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration)
: RunControl(runConfiguration, sp.runMode)
{
setIcon(QLatin1String(":/images/analyzer_start_small.png"));
m_runConfig = runConfiguration;
m_sp = sp;
......@@ -99,9 +101,4 @@ QString AnalyzerRunControl::displayName() const
return m_runConfig ? m_runConfig->displayName() : m_sp.displayName;
}
QIcon AnalyzerRunControl::icon() const
{
return QIcon(QLatin1String(":/images/analyzer_start_small.png"));
}
} // namespace Analyzer
......@@ -91,7 +91,6 @@ public:
StopResult stop();
bool isRunning() const;
QString displayName() const;
QIcon icon() const;
public slots:
virtual void logApplicationMessage(const QString &, Utils::OutputFormat) {}
......
......@@ -36,8 +36,6 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <QIcon>
using namespace ProjectExplorer;
namespace Android {
......@@ -48,6 +46,7 @@ AndroidRunControl::AndroidRunControl(AndroidRunConfiguration *rc)
, m_runner(new AndroidRunner(this, rc, NormalRunMode))
, m_running(false)
{
setIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL));
}
AndroidRunControl::~AndroidRunControl()
......@@ -105,10 +104,5 @@ QString AndroidRunControl::displayName() const
return m_runner->displayName();
}
QIcon AndroidRunControl::icon() const
{
return QIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL));
}
} // namespace Internal
} // namespace Android
......@@ -50,7 +50,6 @@ public:
StopResult stop();
bool isRunning() const;
QString displayName() const;
QIcon icon() const;
private slots:
void handleRemoteProcessFinished(const QString &error);
......
......@@ -128,6 +128,8 @@ DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfiguration,
: RunControl(runConfiguration, DebugRunMode),
d(new DebuggerRunControlPrivate(runConfiguration))
{
setIcon(QLatin1String(ProjectExplorer::Constants::ICON_DEBUG_SMALL));
connect(this, SIGNAL(finished()), SLOT(handleFinished()));
// Create the engine. Could arguably be moved to the factory, but
// we still have a derived S60DebugControl. Should rarely fail, though.
......@@ -159,11 +161,6 @@ QString DebuggerRunControl::displayName() const
return d->m_engine->startParameters().displayName;
}
QIcon DebuggerRunControl::icon() const
{
return QIcon(QLatin1String(ProjectExplorer::Constants::ICON_DEBUG_SMALL));
}
void DebuggerRunControl::start()
{
QTC_ASSERT(d->m_engine, return);
......
......@@ -64,7 +64,6 @@ public:
StopResult stop(); // Called from SnapshotWindow.
bool isRunning() const;
QString displayName() const;
QIcon icon() const;
void startFailed();
void debuggingFinished();
......
......@@ -33,7 +33,6 @@
#include "iosrunner.h"
#include <projectexplorer/projectexplorerconstants.h>
#include <QIcon>
using namespace ProjectExplorer;
......@@ -45,6 +44,7 @@ IosRunControl::IosRunControl(IosRunConfiguration *rc)
, m_runner(new IosRunner(this, rc, false, false))
, m_running(false)
{
setIcon(QLatin1String(ProjectExplorer::Constants::ICON_DEBUG_SMALL));
}
IosRunControl::~IosRunControl()
......@@ -105,10 +105,5 @@ QString IosRunControl::displayName() const
return m_runner->displayName();
}
QIcon IosRunControl::icon() const
{
return QIcon(QLatin1String(ProjectExplorer::Constants::ICON_DEBUG_SMALL));
}
} // namespace Internal
} // namespace Ios
......@@ -51,7 +51,6 @@ public:
StopResult stop() QTC_OVERRIDE;
bool isRunning() const QTC_OVERRIDE;
QString displayName() const QTC_OVERRIDE;
QIcon icon() const QTC_OVERRIDE;
private slots:
void handleRemoteProcessFinished(bool cleanEnd);
......
......@@ -509,7 +509,7 @@ void AppOutputPane::enableButtons(const RunControl *rc /* = 0 */, bool isRunning
{
if (rc) {
m_reRunButton->setEnabled(!isRunning);
m_reRunButton->setIcon(rc->icon());
m_reRunButton->setIcon(QIcon(rc->icon()));
m_stopAction->setEnabled(isRunning);
if (isRunning && debuggerCore() && rc->applicationProcessHandle().isValid()) {
m_attachButton->setEnabled(true);
......
......@@ -34,7 +34,6 @@
#include <utils/qtcassert.h>
#include <utils/environment.h>
#include <QIcon>
#include <QDir>
namespace ProjectExplorer {
......@@ -68,6 +67,7 @@ RunControl *LocalApplicationRunControlFactory::create(RunConfiguration *runConfi
LocalApplicationRunControl::LocalApplicationRunControl(LocalApplicationRunConfiguration *rc, RunMode mode)
: RunControl(rc, mode), m_running(false)
{
setIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL));
EnvironmentAspect *environment = rc->extraAspect<EnvironmentAspect>();
Utils::Environment env;
if (environment)
......@@ -124,11 +124,6 @@ bool LocalApplicationRunControl::isRunning() const
return m_running;
}
QIcon LocalApplicationRunControl::icon() const
{
return QIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL));
}
void LocalApplicationRunControl::slotAppendMessage(const QString &err,
Utils::OutputFormat format)
{
......
......@@ -57,7 +57,6 @@ public:
virtual void start();
virtual StopResult stop();
virtual bool isRunning() const;
virtual QIcon icon() const;
private slots:
void processStarted();
void processExited(int exitCode, QProcess::ExitStatus status);
......
......@@ -40,8 +40,6 @@
#include <QPointer>
#include <QWidget>
QT_FORWARD_DECLARE_CLASS(QIcon)
namespace Utils { class OutputFormatter; }
namespace ProjectExplorer {
......@@ -286,7 +284,9 @@ public:
virtual StopResult stop() = 0;
virtual bool isRunning() const = 0;
virtual QString displayName() const;
virtual QIcon icon() const = 0;
void setIcon(const QString &icon) { m_icon = icon; }
QString icon() const { return m_icon; }
ProcessHandle applicationProcessHandle() const;
void setApplicationProcessHandle(const ProcessHandle &handle);
......@@ -321,6 +321,7 @@ protected:
private:
QString m_displayName;
RunMode m_runMode;
QString m_icon;
const QPointer<RunConfiguration> m_runConfiguration;
Utils::OutputFormatter *m_outputFormatter;
......
......@@ -43,6 +43,8 @@ using namespace Qnx::Internal;
BlackBerryRunControl::BlackBerryRunControl(BlackBerryRunConfiguration *runConfiguration)
: ProjectExplorer::RunControl(runConfiguration, ProjectExplorer::NormalRunMode)
{
setIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL));
m_runner = new BlackBerryApplicationRunner(BlackBerryApplicationRunner::LaunchFlags(), runConfiguration, this);
connect(m_runner, SIGNAL(started()), this, SIGNAL(started()));
......@@ -67,11 +69,6 @@ bool BlackBerryRunControl::isRunning() const
return m_runner->isRunning();
}
QIcon BlackBerryRunControl::icon() const
{
return QIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL));
}
void BlackBerryRunControl::handleStartFailed(const QString &message)
{
appendMessage(message, Utils::StdErrFormat);
......
......@@ -52,7 +52,6 @@ public:
void start();
ProjectExplorer::RunControl::StopResult stop();
bool isRunning() const;
QIcon icon() const;
private slots:
void handleStartFailed(const QString &message);
......
......@@ -58,6 +58,8 @@ public:
RemoteLinuxRunControl::RemoteLinuxRunControl(RunConfiguration *rc)
: RunControl(rc, ProjectExplorer::NormalRunMode), d(new RemoteLinuxRunControlPrivate)
{
setIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL));
d->running = false;
d->device = DeviceKitInformation::device(rc->target()->kit());
const AbstractRemoteLinuxRunConfiguration * const lrc = qobject_cast<AbstractRemoteLinuxRunConfiguration *>(rc);
......@@ -124,11 +126,6 @@ bool RemoteLinuxRunControl::isRunning() const
return d->running;
}
QIcon RemoteLinuxRunControl::icon() const
{
return QIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL));
}
void RemoteLinuxRunControl::setFinished()
{
d->runner.disconnect(this);
......
......@@ -46,7 +46,6 @@ public:
virtual void start();
virtual StopResult stop();
virtual bool isRunning() const;
virtual QIcon icon() const;
private slots:
void handleErrorMessage(const QString &error);
......
......@@ -60,6 +60,7 @@ WinRtRunControl::WinRtRunControl(WinRtRunConfiguration *runConfiguration, RunMod
, m_state(StoppedState)
, m_runner(0)
{
setIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL));
}
void WinRtRunControl::start()
......@@ -84,11 +85,6 @@ bool WinRtRunControl::isRunning() const
return m_state == StartedState;
}
QIcon WinRtRunControl::icon() const
{
return QIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL));
}
void WinRtRunControl::onProcessStarted()
{
QTC_CHECK(m_state == StartingState);
......
......@@ -58,7 +58,6 @@ public:
void start();
StopResult stop();
bool isRunning() const;
QIcon icon() const;
private slots:
void onProcessStarted();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment