forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.8'
Conflicts: src/plugins/fakevim/fakevimhandler.cpp Change-Id: I8101f18b87859924644471817d4f1408790d5628
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -101,6 +101,8 @@ AndroidRunner::AndroidRunner(QObject *parent,
|
||||
QByteArray which = psProc.readAll();
|
||||
m_isBusyBox = which.startsWith("busybox");
|
||||
|
||||
m_checkPIDTimer.setInterval(1000);
|
||||
|
||||
connect(&m_adbLogcatProcess, SIGNAL(readyReadStandardOutput()), SLOT(logcatReadStandardOutput()));
|
||||
connect(&m_adbLogcatProcess, SIGNAL(readyReadStandardError()), SLOT(logcatReadStandardError()));
|
||||
connect(&m_checkPIDTimer, SIGNAL(timeout()), SLOT(checkPID()));
|
||||
@@ -154,8 +156,10 @@ void AndroidRunner::checkPID()
|
||||
return;
|
||||
QByteArray psOut = runPs();
|
||||
m_processPID = extractPid(m_packageName, psOut);
|
||||
if (m_processPID == -1)
|
||||
if (m_processPID == -1) {
|
||||
m_checkPIDTimer.stop();
|
||||
emit remoteProcessFinished(tr("\n\n'%1' died.").arg(m_packageName));
|
||||
}
|
||||
}
|
||||
|
||||
void AndroidRunner::forceStop()
|
||||
@@ -186,7 +190,6 @@ void AndroidRunner::start()
|
||||
{
|
||||
m_adbLogcatProcess.start(m_adb, selector() << _("logcat"));
|
||||
m_wasStarted = false;
|
||||
m_checkPIDTimer.start(1000); // check if the application is alive every 1 seconds
|
||||
QtConcurrent::run(this, &AndroidRunner::asyncStart);
|
||||
}
|
||||
|
||||
@@ -300,6 +303,8 @@ void AndroidRunner::asyncStart()
|
||||
return;
|
||||
}
|
||||
|
||||
QMetaObject::invokeMethod(&m_checkPIDTimer, "start");
|
||||
|
||||
m_wasStarted = true;
|
||||
if (m_useCppDebugger) {
|
||||
// This will be funneled to the engine to actually start and attach
|
||||
|
||||
Reference in New Issue
Block a user