Commit 583cd113 authored by Daniel Teske's avatar Daniel Teske

Android: Hide bundle qt option for Qt4

Task-number: QTCREATORBUG-9408

Change-Id: Ie86deea4b453d3ab3ebcf359c3e0b321a2cba33e
Reviewed-by: default avatarBogDan Vatra <bogdan@kde.org>
parent 19027b38
......@@ -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;
......
......@@ -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;
};
......
......@@ -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()
......
......@@ -56,6 +56,7 @@ private slots:
void setQASIPackagePath();
void cleanLibsOnDevice();
void deployOptionsChanged();
private:
virtual QString summaryText() const;
virtual QString displayName() 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