Commit e7ac3bf1 authored by Fawzi Mohamed's avatar Fawzi Mohamed

ios: fix deploystep displayName updating

still uses the default deploystepconfiguration, which gives some
artifacts (to be fixed later)

Change-Id: I3f4f8a71fbe4e18fc171aee571da72da1c9735db
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent f7a4e447
...@@ -40,6 +40,9 @@ ...@@ -40,6 +40,9 @@
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <projectexplorer/taskhub.h> #include <projectexplorer/taskhub.h>
#include <projectexplorer/kitmanager.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/devicesupport/devicemanager.h>
#include <qmakeprojectmanager/qmakebuildconfiguration.h> #include <qmakeprojectmanager/qmakebuildconfiguration.h>
#include <qmakeprojectmanager/qmakeproject.h> #include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h> #include <qmakeprojectmanager/qmakenodes.h>
...@@ -82,14 +85,26 @@ void IosDeployStep::ctor() ...@@ -82,14 +85,26 @@ void IosDeployStep::ctor()
{ {
m_toolHandler = 0; m_toolHandler = 0;
m_transferStatus = NoTransfer; m_transferStatus = NoTransfer;
m_device = ProjectExplorer::DeviceKitInformation::device(target()->kit()); cleanup();
const QString devName = m_device.isNull() ? IosDevice::name() : m_device->displayName(); 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)); setDefaultDisplayName(tr("Deploy to %1").arg(devName));
setDisplayName(tr("Deploy to %1").arg(devName));
} }
bool IosDeployStep::init() bool IosDeployStep::init()
{ {
QTC_CHECK(m_transferStatus == NoTransfer); QTC_ASSERT(m_transferStatus == NoTransfer, return false);
m_device = ProjectExplorer::DeviceKitInformation::device(target()->kit()); m_device = ProjectExplorer::DeviceKitInformation::device(target()->kit());
IosRunConfiguration * runConfig = qobject_cast<IosRunConfiguration *>( IosRunConfiguration * runConfig = qobject_cast<IosRunConfiguration *>(
this->target()->activeRunConfiguration()); this->target()->activeRunConfiguration());
......
...@@ -73,9 +73,6 @@ public: ...@@ -73,9 +73,6 @@ public:
void run(QFutureInterface<bool> &fi) QTC_OVERRIDE; void run(QFutureInterface<bool> &fi) QTC_OVERRIDE;
void cleanup(); void cleanup();
ProjectExplorer::IDevice::ConstPtr device() const;
IosDevice::ConstPtr iosdevice() const;
IosSimulator::ConstPtr iossimulator() const;
void cancel(); void cancel();
signals: signals:
//void done(); //void done();
...@@ -89,7 +86,7 @@ private slots: ...@@ -89,7 +86,7 @@ private slots:
Ios::IosToolHandler::OpStatus status); Ios::IosToolHandler::OpStatus status);
void handleFinished(Ios::IosToolHandler *handler); void handleFinished(Ios::IosToolHandler *handler);
void handleErrorMsg(Ios::IosToolHandler *handler, const QString &msg); void handleErrorMsg(Ios::IosToolHandler *handler, const QString &msg);
void updateDisplayNames();
private: private:
IosDeployStep(ProjectExplorer::BuildStepList *bc, IosDeployStep(ProjectExplorer::BuildStepList *bc,
IosDeployStep *other); IosDeployStep *other);
...@@ -97,6 +94,9 @@ private: ...@@ -97,6 +94,9 @@ private:
ProjectExplorer::BuildStepConfigWidget *createConfigWidget() QTC_OVERRIDE; ProjectExplorer::BuildStepConfigWidget *createConfigWidget() QTC_OVERRIDE;
bool immutable() const QTC_OVERRIDE { return true; } bool immutable() const QTC_OVERRIDE { return true; }
bool runInGuiThread() 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(); void ctor();
QString deviceId() const; QString deviceId() const;
......
...@@ -46,6 +46,7 @@ IosDeployStepWidget::IosDeployStepWidget(IosDeployStep *step) : ...@@ -46,6 +46,7 @@ IosDeployStepWidget::IosDeployStepWidget(IosDeployStep *step) :
m_step(step) m_step(step)
{ {
ui->setupUi(this); ui->setupUi(this);
connect(m_step, SIGNAL(displayNameChanged()), SIGNAL(updateSummary()));
} }
IosDeployStepWidget::~IosDeployStepWidget() IosDeployStepWidget::~IosDeployStepWidget()
...@@ -55,8 +56,7 @@ IosDeployStepWidget::~IosDeployStepWidget() ...@@ -55,8 +56,7 @@ IosDeployStepWidget::~IosDeployStepWidget()
QString IosDeployStepWidget::displayName() const QString IosDeployStepWidget::displayName() const
{ {
const QString deviceName = m_step->device().isNull() ? IosDevice::name() : m_step->device()->displayName(); return QString::fromLatin1("<b>%1</b>").arg(m_step->displayName());
return tr("<b>Deploy to %1</b>").arg(deviceName);
} }
QString IosDeployStepWidget::summaryText() const QString IosDeployStepWidget::summaryText() const
......
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