diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp index 12f1edaf55e..d5c49623b1b 100644 --- a/src/plugins/android/androidsettingswidget.cpp +++ b/src/plugins/android/androidsettingswidget.cpp @@ -134,9 +134,6 @@ AndroidSettingsWidget::AndroidSettingsWidget(QWidget *parent) { m_ui->setupUi(this); - connect(&m_checkGdbWatcher, &QFutureWatcherBase::finished, - this, &AndroidSettingsWidget::checkGdbFinished); - m_ui->SDKLocationPathChooser->setFileName(m_androidConfig.sdkLocation()); m_ui->SDKLocationPathChooser->setPromptDialogTitle(tr("Select Android SDK folder")); m_ui->NDKLocationPathChooser->setFileName(m_androidConfig.ndkLocation()); @@ -158,12 +155,8 @@ AndroidSettingsWidget::AndroidSettingsWidget(QWidget *parent) const QPixmap errorPixmap = Utils::Icons::CRITICAL.pixmap(); m_ui->sdkWarningIconLabel->setPixmap(errorPixmap); - m_ui->gdbWarningIconLabel->setPixmap(errorPixmap); m_ui->ndkWarningIconLabel->setPixmap(errorPixmap); - connect(m_ui->gdbWarningLabel, &QLabel::linkActivated, - this, &AndroidSettingsWidget::showGdbWarningDialog); - connect(&m_virtualDevicesWatcher, &QFutureWatcherBase::finished, this, &AndroidSettingsWidget::updateAvds); @@ -209,50 +202,6 @@ AndroidSettingsWidget::~AndroidSettingsWidget() m_futureWatcher.waitForFinished(); } -// NOTE: Will be run via QFuture -static QPair checkGdbForBrokenPython(const QStringList &paths) -{ - foreach (const QString &path, paths) { - QTime timer; - timer.start(); - QProcess proc; - proc.setProcessChannelMode(QProcess::MergedChannels); - proc.start(path); - proc.waitForStarted(); - - QByteArray output; - while (proc.waitForReadyRead(300)) { - output += proc.readAll(); - if (output.contains("(gdb)")) - break; - if (timer.elapsed() > 7 * 1000) - return qMakePair(paths, true); // Took too long, abort - } - - output.clear(); - - proc.write("python import string\n"); - proc.write("python print(string.ascii_uppercase)\n"); - proc.write("python import struct\n"); - proc.write("quit\n"); - while (proc.waitForFinished(300)) { - if (timer.elapsed() > 9 * 1000) - return qMakePair(paths, true); // Took too long, abort - } - proc.waitForFinished(); - - output = proc.readAll(); - - bool error = output.contains("_PyObject_Free") - || output.contains("_PyExc_IOError") - || output.contains("_sysconfigdata_nd ") - || !output.contains("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); - if (error) - return qMakePair(paths, error); - } - return qMakePair(paths, false); -} - void AndroidSettingsWidget::check(AndroidSettingsWidget::Mode mode) { if (mode & Sdk) { @@ -264,8 +213,6 @@ void AndroidSettingsWidget::check(AndroidSettingsWidget::Mode mode) Utils::FileName platformPath = m_androidConfig.ndkLocation(); Utils::FileName toolChainPath = m_androidConfig.ndkLocation(); Utils::FileName sourcesPath = m_androidConfig.ndkLocation(); - m_ui->gdbWarningIconLabel->setVisible(false); - m_ui->gdbWarningLabel->setVisible(false); if (m_androidConfig.ndkLocation().isEmpty()) { m_ndkState = NotSet; } else if (!platformPath.appendPath(QLatin1String("platforms")).exists() @@ -282,24 +229,6 @@ void AndroidSettingsWidget::check(AndroidSettingsWidget::Mode mode) = AndroidToolChainFactory::toolchainPathsForNdk(m_androidConfig.ndkLocation()); m_ndkCompilerCount = compilerPaths.count(); - // Check for a gdb with a broken python - QStringList gdbPaths; - foreach (const AndroidToolChainFactory::AndroidToolChainInformation &ati, compilerPaths) { - if (ati.language == Core::Id(ProjectExplorer::Constants::C_LANGUAGE_ID)) - continue; - // we only check the arm gdbs, that's indicative enough - if (ati.abi.architecture() != ProjectExplorer::Abi::ArmArchitecture) - continue; - Utils::FileName gdbPath = m_androidConfig.gdbPath(ati.abi, ati.version); - if (gdbPath.exists()) - gdbPaths << gdbPath.toString(); - } - - if (!gdbPaths.isEmpty()) { - m_checkGdbWatcher.setFuture(Utils::runAsync(&checkGdbForBrokenPython, gdbPaths)); - m_gdbCheckPaths = gdbPaths; - } - // See if we have qt versions for those toolchains QSet toolchainsForAbi; foreach (const AndroidToolChainFactory::AndroidToolChainInformation &ati, compilerPaths) { @@ -591,25 +520,6 @@ void AndroidSettingsWidget::createKitToggled() m_androidConfig.setAutomaticKitCreation(m_ui->CreateKitCheckBox->isChecked()); } -void AndroidSettingsWidget::checkGdbFinished() -{ - QPair result = m_checkGdbWatcher.future().result(); - if (result.first != m_gdbCheckPaths) // no longer relevant - return; - m_ui->gdbWarningIconLabel->setVisible(result.second); - m_ui->gdbWarningLabel->setVisible(result.second); -} - -void AndroidSettingsWidget::showGdbWarningDialog() -{ - QMessageBox::warning(this, - tr("Unsupported GDB"), - tr("The GDB inside this NDK seems to not support Python. " - "The Qt Project offers fixed GDB builds at: " - "" - "http://download.qt.io/official_releases/gdb/")); -} - void AndroidSettingsWidget::manageAVD() { if (m_avdManager->avdManagerUiToolAvailable()) { diff --git a/src/plugins/android/androidsettingswidget.h b/src/plugins/android/androidsettingswidget.h index becc6e0e8fe..32127543657 100644 --- a/src/plugins/android/androidsettingswidget.h +++ b/src/plugins/android/androidsettingswidget.h @@ -88,8 +88,6 @@ private: void manageAVD(); void createKitToggled(); - void checkGdbFinished(); - void showGdbWarningDialog(); void updateAvds(); private: @@ -114,8 +112,6 @@ private: AndroidConfig m_androidConfig; AvdModel m_AVDModel; QFutureWatcher m_futureWatcher; - QFutureWatcher> m_checkGdbWatcher; - QStringList m_gdbCheckPaths; QFutureWatcher m_virtualDevicesWatcher; QString m_lastAddedAvd; diff --git a/src/plugins/android/androidsettingswidget.ui b/src/plugins/android/androidsettingswidget.ui index cf0972c4eae..0d8bcb774d5 100644 --- a/src/plugins/android/androidsettingswidget.ui +++ b/src/plugins/android/androidsettingswidget.ui @@ -14,16 +14,7 @@ Android Configuration - - - - - - - - - - + QFrame::StyledPanel @@ -142,6 +133,15 @@ + + + + + + + + + @@ -186,6 +186,155 @@ + + + + + 0 + 0 + + + + Android SDK location: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Download JDK + + + + :/android/images/download.png:/android/images/download.png + + + + + + + Download Android SDK + + + + :/android/images/download.png:/android/images/download.png + + + + + + + 2 + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + + + true + + + + + + + + + 2 + + + 0 + + + + + + 0 + 0 + + + + Automatically create kits for Android tool chains + + + true + + + + + + + + + + 0 + 0 + + + + Android NDK location: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 2 + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + + + + + @@ -235,188 +384,6 @@ - - - - 2 - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - - - - - - - - - - - 0 - 0 - - - - Android NDK location: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Download Android SDK - - - - :/android/images/download.png:/android/images/download.png - - - - - - - 2 - - - 0 - - - - - - 0 - 0 - - - - Automatically create kits for Android tool chains - - - true - - - - - - - - - 2 - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - - - - true - - - - - - - - - 2 - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - <a href="xx">The GDB in the NDK appears to have broken python support.</a> - - - - - - - - - Download JDK - - - - :/android/images/download.png:/android/images/download.png - - - - - - - - 0 - 0 - - - - Android SDK location: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - -