diff options
author | hjk <hjk121@nokiamail.com> | 2014-05-27 18:50:55 +0200 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2014-05-30 13:07:54 +0200 |
commit | 26b54747e2e8c876d2aaa32103f7907aab9fd8e1 (patch) | |
tree | c1d8ddeb1df99d489ecf8e77cea13712703edb76 | |
parent | fb494b735564c9099e2555f1b4b94b6770defaa9 (diff) | |
download | qt-creator-26b54747e2e8c876d2aaa32103f7907aab9fd8e1.tar.gz |
RunControl: Make icon(path) a value member
Change-Id: I7f7099d03a25a14d8df02273cca928e9f1fbfe1d
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
-rw-r--r-- | src/plugins/analyzerbase/analyzerruncontrol.cpp | 7 | ||||
-rw-r--r-- | src/plugins/analyzerbase/analyzerruncontrol.h | 1 | ||||
-rw-r--r-- | src/plugins/android/androidruncontrol.cpp | 8 | ||||
-rw-r--r-- | src/plugins/android/androidruncontrol.h | 1 | ||||
-rw-r--r-- | src/plugins/debugger/debuggerrunner.cpp | 7 | ||||
-rw-r--r-- | src/plugins/debugger/debuggerrunner.h | 1 | ||||
-rw-r--r-- | src/plugins/ios/iosruncontrol.cpp | 7 | ||||
-rw-r--r-- | src/plugins/ios/iosruncontrol.h | 1 | ||||
-rw-r--r-- | src/plugins/projectexplorer/appoutputpane.cpp | 2 | ||||
-rw-r--r-- | src/plugins/projectexplorer/localapplicationruncontrol.cpp | 7 | ||||
-rw-r--r-- | src/plugins/projectexplorer/localapplicationruncontrol.h | 1 | ||||
-rw-r--r-- | src/plugins/projectexplorer/runconfiguration.h | 7 | ||||
-rw-r--r-- | src/plugins/qnx/blackberryruncontrol.cpp | 7 | ||||
-rw-r--r-- | src/plugins/qnx/blackberryruncontrol.h | 1 | ||||
-rw-r--r-- | src/plugins/remotelinux/remotelinuxruncontrol.cpp | 7 | ||||
-rw-r--r-- | src/plugins/remotelinux/remotelinuxruncontrol.h | 1 | ||||
-rw-r--r-- | src/plugins/winrt/winrtruncontrol.cpp | 6 | ||||
-rw-r--r-- | src/plugins/winrt/winrtruncontrol.h | 1 |
18 files changed, 17 insertions, 56 deletions
diff --git a/src/plugins/analyzerbase/analyzerruncontrol.cpp b/src/plugins/analyzerbase/analyzerruncontrol.cpp index a01cb0b900..eba097bd32 100644 --- a/src/plugins/analyzerbase/analyzerruncontrol.cpp +++ b/src/plugins/analyzerbase/analyzerruncontrol.cpp @@ -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 diff --git a/src/plugins/analyzerbase/analyzerruncontrol.h b/src/plugins/analyzerbase/analyzerruncontrol.h index 2c9ba2af73..2b21ffa41e 100644 --- a/src/plugins/analyzerbase/analyzerruncontrol.h +++ b/src/plugins/analyzerbase/analyzerruncontrol.h @@ -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) {} diff --git a/src/plugins/android/androidruncontrol.cpp b/src/plugins/android/androidruncontrol.cpp index a3563c9125..49c9d70c6c 100644 --- a/src/plugins/android/androidruncontrol.cpp +++ b/src/plugins/android/androidruncontrol.cpp @@ -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 diff --git a/src/plugins/android/androidruncontrol.h b/src/plugins/android/androidruncontrol.h index 74c119d559..48f9ca6a32 100644 --- a/src/plugins/android/androidruncontrol.h +++ b/src/plugins/android/androidruncontrol.h @@ -50,7 +50,6 @@ public: StopResult stop(); bool isRunning() const; QString displayName() const; - QIcon icon() const; private slots: void handleRemoteProcessFinished(const QString &error); diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index ef452add35..1b30a6aba5 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -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); diff --git a/src/plugins/debugger/debuggerrunner.h b/src/plugins/debugger/debuggerrunner.h index a4c973440c..db58f31294 100644 --- a/src/plugins/debugger/debuggerrunner.h +++ b/src/plugins/debugger/debuggerrunner.h @@ -64,7 +64,6 @@ public: StopResult stop(); // Called from SnapshotWindow. bool isRunning() const; QString displayName() const; - QIcon icon() const; void startFailed(); void debuggingFinished(); diff --git a/src/plugins/ios/iosruncontrol.cpp b/src/plugins/ios/iosruncontrol.cpp index a0145b36a8..9877816ed6 100644 --- a/src/plugins/ios/iosruncontrol.cpp +++ b/src/plugins/ios/iosruncontrol.cpp @@ -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 diff --git a/src/plugins/ios/iosruncontrol.h b/src/plugins/ios/iosruncontrol.h index 46b520a2ab..1c742cceca 100644 --- a/src/plugins/ios/iosruncontrol.h +++ b/src/plugins/ios/iosruncontrol.h @@ -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); diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index 38a0858fec..24462a8975 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -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); diff --git a/src/plugins/projectexplorer/localapplicationruncontrol.cpp b/src/plugins/projectexplorer/localapplicationruncontrol.cpp index 13c248e42d..d0a78621d1 100644 --- a/src/plugins/projectexplorer/localapplicationruncontrol.cpp +++ b/src/plugins/projectexplorer/localapplicationruncontrol.cpp @@ -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) { diff --git a/src/plugins/projectexplorer/localapplicationruncontrol.h b/src/plugins/projectexplorer/localapplicationruncontrol.h index c5209a034c..f02e993eb2 100644 --- a/src/plugins/projectexplorer/localapplicationruncontrol.h +++ b/src/plugins/projectexplorer/localapplicationruncontrol.h @@ -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); diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index e0206a5741..2e64ade1a4 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -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; diff --git a/src/plugins/qnx/blackberryruncontrol.cpp b/src/plugins/qnx/blackberryruncontrol.cpp index 660ca53f59..9be6fc81c3 100644 --- a/src/plugins/qnx/blackberryruncontrol.cpp +++ b/src/plugins/qnx/blackberryruncontrol.cpp @@ -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); diff --git a/src/plugins/qnx/blackberryruncontrol.h b/src/plugins/qnx/blackberryruncontrol.h index c1278bc058..ddbf41e870 100644 --- a/src/plugins/qnx/blackberryruncontrol.h +++ b/src/plugins/qnx/blackberryruncontrol.h @@ -52,7 +52,6 @@ public: void start(); ProjectExplorer::RunControl::StopResult stop(); bool isRunning() const; - QIcon icon() const; private slots: void handleStartFailed(const QString &message); diff --git a/src/plugins/remotelinux/remotelinuxruncontrol.cpp b/src/plugins/remotelinux/remotelinuxruncontrol.cpp index 9a1141f167..42673f0a5a 100644 --- a/src/plugins/remotelinux/remotelinuxruncontrol.cpp +++ b/src/plugins/remotelinux/remotelinuxruncontrol.cpp @@ -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); diff --git a/src/plugins/remotelinux/remotelinuxruncontrol.h b/src/plugins/remotelinux/remotelinuxruncontrol.h index d8d10d7236..87b71c34d5 100644 --- a/src/plugins/remotelinux/remotelinuxruncontrol.h +++ b/src/plugins/remotelinux/remotelinuxruncontrol.h @@ -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); diff --git a/src/plugins/winrt/winrtruncontrol.cpp b/src/plugins/winrt/winrtruncontrol.cpp index 92598c34e6..ae0635ae93 100644 --- a/src/plugins/winrt/winrtruncontrol.cpp +++ b/src/plugins/winrt/winrtruncontrol.cpp @@ -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); diff --git a/src/plugins/winrt/winrtruncontrol.h b/src/plugins/winrt/winrtruncontrol.h index 1779894c5c..3c058197d8 100644 --- a/src/plugins/winrt/winrtruncontrol.h +++ b/src/plugins/winrt/winrtruncontrol.h @@ -58,7 +58,6 @@ public: void start(); StopResult stop(); bool isRunning() const; - QIcon icon() const; private slots: void onProcessStarted(); |