summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFawzi Mohamed <fawzi.mohamed@digia.com>2014-05-13 16:09:11 +0200
committerFawzi Mohamed <fawzi.mohamed@digia.com>2014-05-27 15:37:31 +0200
commite7ac3bf16ea9035eec0dbb83b7b85e7e469bc799 (patch)
tree83608c87ce4ab4221850f1379da0cb353c3bd555
parentf7a4e4476484ae7b767191f99b58fe3f20be5740 (diff)
downloadqt-creator-e7ac3bf16ea9035eec0dbb83b7b85e7e469bc799.tar.gz
ios: fix deploystep displayName updating
still uses the default deploystepconfiguration, which gives some artifacts (to be fixed later) Change-Id: I3f4f8a71fbe4e18fc171aee571da72da1c9735db Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
-rw-r--r--src/plugins/ios/iosdeploystep.cpp21
-rw-r--r--src/plugins/ios/iosdeploystep.h8
-rw-r--r--src/plugins/ios/iosdeploystepwidget.cpp4
3 files changed, 24 insertions, 9 deletions
diff --git a/src/plugins/ios/iosdeploystep.cpp b/src/plugins/ios/iosdeploystep.cpp
index ecc2c0f050..a2660c67d9 100644
--- a/src/plugins/ios/iosdeploystep.cpp
+++ b/src/plugins/ios/iosdeploystep.cpp
@@ -40,6 +40,9 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
#include <projectexplorer/taskhub.h>
+#include <projectexplorer/kitmanager.h>
+#include <projectexplorer/kitinformation.h>
+#include <projectexplorer/devicesupport/devicemanager.h>
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
@@ -82,14 +85,26 @@ void IosDeployStep::ctor()
{
m_toolHandler = 0;
m_transferStatus = NoTransfer;
- m_device = ProjectExplorer::DeviceKitInformation::device(target()->kit());
- const QString devName = m_device.isNull() ? IosDevice::name() : m_device->displayName();
+ cleanup();
+ updateDisplayNames();
+ connect(DeviceManager::instance(), SIGNAL(updated()),
+ SLOT(updateDisplayNames()));
+ connect(target(), SIGNAL(kitChanged()),
+ SLOT(updateDisplayNames()));
+}
+
+void IosDeployStep::updateDisplayNames()
+{
+ ProjectExplorer::IDevice::ConstPtr dev =
+ ProjectExplorer::DeviceKitInformation::device(target()->kit());
+ const QString devName = dev.isNull() ? IosDevice::name() : dev->displayName();
setDefaultDisplayName(tr("Deploy to %1").arg(devName));
+ setDisplayName(tr("Deploy to %1").arg(devName));
}
bool IosDeployStep::init()
{
- QTC_CHECK(m_transferStatus == NoTransfer);
+ QTC_ASSERT(m_transferStatus == NoTransfer, return false);
m_device = ProjectExplorer::DeviceKitInformation::device(target()->kit());
IosRunConfiguration * runConfig = qobject_cast<IosRunConfiguration *>(
this->target()->activeRunConfiguration());
diff --git a/src/plugins/ios/iosdeploystep.h b/src/plugins/ios/iosdeploystep.h
index dae8438769..a5e55bd5e0 100644
--- a/src/plugins/ios/iosdeploystep.h
+++ b/src/plugins/ios/iosdeploystep.h
@@ -73,9 +73,6 @@ public:
void run(QFutureInterface<bool> &fi) QTC_OVERRIDE;
void cleanup();
- ProjectExplorer::IDevice::ConstPtr device() const;
- IosDevice::ConstPtr iosdevice() const;
- IosSimulator::ConstPtr iossimulator() const;
void cancel();
signals:
//void done();
@@ -89,7 +86,7 @@ private slots:
Ios::IosToolHandler::OpStatus status);
void handleFinished(Ios::IosToolHandler *handler);
void handleErrorMsg(Ios::IosToolHandler *handler, const QString &msg);
-
+ void updateDisplayNames();
private:
IosDeployStep(ProjectExplorer::BuildStepList *bc,
IosDeployStep *other);
@@ -97,6 +94,9 @@ private:
ProjectExplorer::BuildStepConfigWidget *createConfigWidget() QTC_OVERRIDE;
bool immutable() const QTC_OVERRIDE { return true; }
bool runInGuiThread() const QTC_OVERRIDE { return true; }
+ ProjectExplorer::IDevice::ConstPtr device() const;
+ IosDevice::ConstPtr iosdevice() const;
+ IosSimulator::ConstPtr iossimulator() const;
void ctor();
QString deviceId() const;
diff --git a/src/plugins/ios/iosdeploystepwidget.cpp b/src/plugins/ios/iosdeploystepwidget.cpp
index 3c9dea8bd2..fe20218ee6 100644
--- a/src/plugins/ios/iosdeploystepwidget.cpp
+++ b/src/plugins/ios/iosdeploystepwidget.cpp
@@ -46,6 +46,7 @@ IosDeployStepWidget::IosDeployStepWidget(IosDeployStep *step) :
m_step(step)
{
ui->setupUi(this);
+ connect(m_step, SIGNAL(displayNameChanged()), SIGNAL(updateSummary()));
}
IosDeployStepWidget::~IosDeployStepWidget()
@@ -55,8 +56,7 @@ IosDeployStepWidget::~IosDeployStepWidget()
QString IosDeployStepWidget::displayName() const
{
- const QString deviceName = m_step->device().isNull() ? IosDevice::name() : m_step->device()->displayName();
- return tr("<b>Deploy to %1</b>").arg(deviceName);
+ return QString::fromLatin1("<b>%1</b>").arg(m_step->displayName());
}
QString IosDeployStepWidget::summaryText() const