diff options
author | Daniel Teske <daniel.teske@digia.com> | 2013-06-13 16:38:03 +0200 |
---|---|---|
committer | Daniel Teske <daniel.teske@digia.com> | 2013-06-17 12:14:14 +0200 |
commit | 583cd11371b457d8a04e52474efa025f624822f7 (patch) | |
tree | d175b41fea6ae82bae4f19756cf2919f52b62c53 | |
parent | 19027b389741790d978846cf7c3bda5202be16ff (diff) | |
download | qt-creator-583cd11371b457d8a04e52474efa025f624822f7.tar.gz |
Android: Hide bundle qt option for Qt4
Task-number: QTCREATORBUG-9408
Change-Id: Ie86deea4b453d3ab3ebcf359c3e0b321a2cba33e
Reviewed-by: BogDan Vatra <bogdan@kde.org>
-rw-r--r-- | src/plugins/android/androiddeploystep.cpp | 42 | ||||
-rw-r--r-- | src/plugins/android/androiddeploystep.h | 4 | ||||
-rw-r--r-- | src/plugins/android/androiddeploystepwidget.cpp | 22 | ||||
-rw-r--r-- | src/plugins/android/androiddeploystepwidget.h | 1 |
4 files changed, 60 insertions, 9 deletions
diff --git a/src/plugins/android/androiddeploystep.cpp b/src/plugins/android/androiddeploystep.cpp index c11ced5f1e..04eeb91f02 100644 --- a/src/plugins/android/androiddeploystep.cpp +++ b/src/plugins/android/androiddeploystep.cpp @@ -83,9 +83,14 @@ void AndroidDeployStep::ctor() setDefaultDisplayName(tr("Deploy to Android device")); m_deployAction = NoDeploy; - if (QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(target()->kit())) - if (qt->qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0)) - m_deployAction = BundleLibraries; + QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(target()->kit()); + m_bundleQtAvailable = qt && qt->qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0); + if (m_bundleQtAvailable) + m_deployAction = BundleLibraries; + + + connect(ProjectExplorer::KitManager::instance(), SIGNAL(kitUpdated(ProjectExplorer::Kit*)), + this, SLOT(kitUpdated(ProjectExplorer::Kit *))); } bool AndroidDeployStep::init() @@ -157,6 +162,14 @@ bool AndroidDeployStep::fromMap(const QVariantMap &map) if (m_deployAction == InstallQASI) m_deployAction = NoDeploy; + QtSupport::BaseQtVersion *qtVersion + = QtSupport::QtKitInformation::qtVersion(target()->kit()); + if (m_deployAction == BundleLibraries) + if (!qtVersion || qtVersion->qtVersion() < QtSupport::QtVersionNumber(5, 0, 0)) + m_deployAction = NoDeploy; // the kit changed to a non qt5 kit + + m_bundleQtAvailable = qtVersion && qtVersion->qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0); + return ProjectExplorer::BuildStep::fromMap(map); } @@ -201,6 +214,24 @@ void AndroidDeployStep::processFinished() process->deleteLater(); } +void AndroidDeployStep::kitUpdated(Kit *kit) +{ + if (kit != target()->kit()) + return; + QtSupport::BaseQtVersion *qtVersion + = QtSupport::QtKitInformation::qtVersion(target()->kit()); + + bool newBundleQtAvailable = qtVersion && qtVersion->qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0); + if (m_bundleQtAvailable != newBundleQtAvailable) { + m_bundleQtAvailable = newBundleQtAvailable; + + if (!m_bundleQtAvailable && m_deployAction == BundleLibraries) + m_deployAction = NoDeploy; // the kit changed to a non qt5 kit + + emit deployOptionsChanged(); + } +} + void AndroidDeployStep::installQASIPackage(const QString &packagePath) { const QString targetArch = AndroidManager::targetArch(target()); @@ -226,6 +257,11 @@ void AndroidDeployStep::installQASIPackage(const QString &packagePath) delete process; } +bool AndroidDeployStep::bundleQtOptionAvailable() +{ + return m_bundleQtAvailable; +} + void AndroidDeployStep::setDeployAction(AndroidDeployStep::AndroidDeployAction deploy) { m_deployAction = deploy; diff --git a/src/plugins/android/androiddeploystep.h b/src/plugins/android/androiddeploystep.h index ad922c46e1..6725020a85 100644 --- a/src/plugins/android/androiddeploystep.h +++ b/src/plugins/android/androiddeploystep.h @@ -96,6 +96,7 @@ public: void cleanLibsOnDevice(); void installQASIPackage(const QString &packagePath); + bool bundleQtOptionAvailable(); public slots: void setDeployAction(AndroidDeployAction deploy); @@ -103,12 +104,14 @@ public slots: signals: void done(); void error(); + void deployOptionsChanged(); private slots: bool deployPackage(); void handleBuildOutput(); void handleBuildError(); void processFinished(); + void kitUpdated(ProjectExplorer::Kit *kit); private: AndroidDeployStep(ProjectExplorer::BuildStepList *bc, @@ -151,6 +154,7 @@ private: AndroidDeployAction m_runDeployAction; QString m_ndkToolChainVersion; QString m_libgnustl; + bool m_bundleQtAvailable; static const Core::Id Id; }; diff --git a/src/plugins/android/androiddeploystepwidget.cpp b/src/plugins/android/androiddeploystepwidget.cpp index 482051342c..93140abf3c 100644 --- a/src/plugins/android/androiddeploystepwidget.cpp +++ b/src/plugins/android/androiddeploystepwidget.cpp @@ -47,6 +47,21 @@ AndroidDeployStepWidget::AndroidDeployStepWidget(AndroidDeployStep *step) : { ui->setupUi(this); + deployOptionsChanged(); + + connect(ui->ministroOption, SIGNAL(clicked()), SLOT(setMinistro())); + connect(ui->temporaryQtOption, SIGNAL(clicked()), SLOT(setDeployLocalQtLibs())); + connect(ui->bundleQtOption, SIGNAL(clicked()), SLOT(setBundleQtLibs())); + + connect(ui->chooseButton, SIGNAL(clicked()), SLOT(setQASIPackagePath())); + connect(ui->cleanLibsPushButton, SIGNAL(clicked()), SLOT(cleanLibsOnDevice())); + + connect(m_step, SIGNAL(deployOptionsChanged()), + this, SLOT(deployOptionsChanged())); +} + +void AndroidDeployStepWidget::deployOptionsChanged() +{ switch (m_step->deployAction()) { case AndroidDeployStep::NoDeploy: ui->ministroOption->setChecked(true); @@ -62,12 +77,7 @@ AndroidDeployStepWidget::AndroidDeployStepWidget(AndroidDeployStep *step) : break; } - connect(ui->ministroOption, SIGNAL(clicked()), SLOT(setMinistro())); - connect(ui->temporaryQtOption, SIGNAL(clicked()), SLOT(setDeployLocalQtLibs())); - connect(ui->bundleQtOption, SIGNAL(clicked()), SLOT(setBundleQtLibs())); - - connect(ui->chooseButton, SIGNAL(clicked()), SLOT(setQASIPackagePath())); - connect(ui->cleanLibsPushButton, SIGNAL(clicked()), SLOT(cleanLibsOnDevice())); + ui->bundleQtOption->setVisible(m_step->bundleQtOptionAvailable()); } AndroidDeployStepWidget::~AndroidDeployStepWidget() diff --git a/src/plugins/android/androiddeploystepwidget.h b/src/plugins/android/androiddeploystepwidget.h index 8c05d0aa62..94bea1c6de 100644 --- a/src/plugins/android/androiddeploystepwidget.h +++ b/src/plugins/android/androiddeploystepwidget.h @@ -56,6 +56,7 @@ private slots: void setQASIPackagePath(); void cleanLibsOnDevice(); + void deployOptionsChanged(); private: virtual QString summaryText() const; virtual QString displayName() const; |