diff options
author | Vikas Pachdha <vikas.pachdha@qt.io> | 2017-09-14 10:29:53 +0200 |
---|---|---|
committer | Vikas Pachdha <vikas.pachdha@qt.io> | 2017-09-14 09:16:40 +0000 |
commit | bc32c380a54eb702528a874f4ab5abb596e005c6 (patch) | |
tree | dbbfd5865755fe4bf6f90b5e7a65bc4c7cfb0395 | |
parent | 027383814a8cb649bd52d4f26fa261fc6bc3dd88 (diff) | |
download | qt-creator-bc32c380a54eb702528a874f4ab5abb596e005c6.tar.gz |
Android: Remove python support checking for the NDK's GDB
The check and the warning was for the super old NDKs which are
not supported anymore
Change-Id: I13cb0d3aa1deb3e5cff284ac4e4960e4d23950b4
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
-rw-r--r-- | src/plugins/android/androidsettingswidget.cpp | 90 | ||||
-rw-r--r-- | src/plugins/android/androidsettingswidget.h | 4 | ||||
-rw-r--r-- | src/plugins/android/androidsettingswidget.ui | 191 |
3 files changed, 79 insertions, 206 deletions
diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp index 12f1edaf55..d5c49623b1 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<QStringList, bool> 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<ProjectExplorer::Abi> 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<QStringList, bool> 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: " - "<a href=\"http://download.qt.io/official_releases/gdb/\">" - "http://download.qt.io/official_releases/gdb/</a>")); -} - void AndroidSettingsWidget::manageAVD() { if (m_avdManager->avdManagerUiToolAvailable()) { diff --git a/src/plugins/android/androidsettingswidget.h b/src/plugins/android/androidsettingswidget.h index becc6e0e8f..3212754365 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<AndroidConfig::CreateAvdInfo> m_futureWatcher; - QFutureWatcher<QPair<QStringList, bool>> m_checkGdbWatcher; - QStringList m_gdbCheckPaths; QFutureWatcher<AndroidDeviceInfoList> m_virtualDevicesWatcher; QString m_lastAddedAvd; diff --git a/src/plugins/android/androidsettingswidget.ui b/src/plugins/android/androidsettingswidget.ui index cf0972c4ea..0d8bcb774d 100644 --- a/src/plugins/android/androidsettingswidget.ui +++ b/src/plugins/android/androidsettingswidget.ui @@ -14,16 +14,7 @@ <string>Android Configuration</string> </property> <layout class="QGridLayout" name="gridLayout"> - <item row="4" column="1"> - <widget class="Utils::PathChooser" name="NDKLocationPathChooser" native="true"/> - </item> - <item row="2" column="1"> - <widget class="Utils::PathChooser" name="SDKLocationPathChooser" native="true"/> - </item> - <item row="0" column="1"> - <widget class="Utils::PathChooser" name="OpenJDKLocationPathChooser" native="true"/> - </item> - <item row="10" column="0" colspan="2"> + <item row="9" column="0" colspan="2"> <widget class="QFrame" name="AVDManagerFrame"> <property name="frameShape"> <enum>QFrame::StyledPanel</enum> @@ -142,6 +133,15 @@ </layout> </widget> </item> + <item row="0" column="1"> + <widget class="Utils::PathChooser" name="OpenJDKLocationPathChooser" native="true"/> + </item> + <item row="2" column="1"> + <widget class="Utils::PathChooser" name="SDKLocationPathChooser" native="true"/> + </item> + <item row="4" column="1"> + <widget class="Utils::PathChooser" name="NDKLocationPathChooser" native="true"/> + </item> <item row="1" column="1"> <layout class="QHBoxLayout" name="horizontalLayout_5"> <item> @@ -186,62 +186,51 @@ </property> </widget> </item> - <item row="3" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <item> - <widget class="QLabel" name="sdkWarningIconLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="sdkWarningLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="OpenJDKLocationLabel"> + <item row="2" column="0"> + <widget class="QLabel" name="SDKLocationLabel"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="text"> - <string>JDK location:</string> + <string>Android SDK location:</string> </property> <property name="alignment"> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> </property> </widget> </item> - <item row="6" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item row="0" column="2"> + <widget class="QToolButton" name="downloadOpenJDKToolButton"> + <property name="toolTip"> + <string>Download JDK</string> + </property> + <property name="icon"> + <iconset resource="android.qrc"> + <normaloff>:/android/images/download.png</normaloff>:/android/images/download.png</iconset> + </property> + </widget> + </item> + <item row="2" column="2"> + <widget class="QToolButton" name="downloadSDKToolButton"> + <property name="toolTip"> + <string>Download Android SDK</string> + </property> + <property name="icon"> + <iconset resource="android.qrc"> + <normaloff>:/android/images/download.png</normaloff>:/android/images/download.png</iconset> + </property> + </widget> + </item> + <item row="8" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_2"> <property name="spacing"> <number>2</number> </property> <item> - <widget class="QLabel" name="ndkWarningIconLabel"> + <widget class="QLabel" name="kitWarningIconLabel"> <property name="sizePolicy"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -254,9 +243,9 @@ </widget> </item> <item> - <widget class="QLabel" name="toolchainFoundLabel"> + <widget class="QLabel" name="kitWarningLabel"> <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -264,38 +253,14 @@ <property name="text"> <string/> </property> + <property name="wordWrap"> + <bool>true</bool> + </property> </widget> </item> </layout> </item> - <item row="4" column="0"> - <widget class="QLabel" name="NDKLocationLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Android NDK location:</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - </widget> - </item> - <item row="2" column="2"> - <widget class="QToolButton" name="downloadSDKToolButton"> - <property name="toolTip"> - <string>Download Android SDK</string> - </property> - <property name="icon"> - <iconset resource="android.qrc"> - <normaloff>:/android/images/download.png</normaloff>:/android/images/download.png</iconset> - </property> - </widget> - </item> - <item row="8" column="1"> + <item row="7" column="1"> <layout class="QHBoxLayout" name="horizontalLayout_8"> <property name="spacing"> <number>2</number> @@ -321,13 +286,29 @@ </item> </layout> </item> - <item row="9" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item row="4" column="0"> + <widget class="QLabel" name="NDKLocationLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Android NDK location:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="5" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_3"> <property name="spacing"> <number>2</number> </property> <item> - <widget class="QLabel" name="kitWarningIconLabel"> + <widget class="QLabel" name="ndkWarningIconLabel"> <property name="sizePolicy"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -340,9 +321,9 @@ </widget> </item> <item> - <widget class="QLabel" name="kitWarningLabel"> + <widget class="QLabel" name="toolchainFoundLabel"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -350,20 +331,14 @@ <property name="text"> <string/> </property> - <property name="wordWrap"> - <bool>true</bool> - </property> </widget> </item> </layout> </item> - <item row="5" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_6"> - <property name="spacing"> - <number>2</number> - </property> + <item row="3" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_4"> <item> - <widget class="QLabel" name="gdbWarningIconLabel"> + <widget class="QLabel" name="sdkWarningIconLabel"> <property name="sizePolicy"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -376,41 +351,33 @@ </widget> </item> <item> - <widget class="QLabel" name="gdbWarningLabel"> + <widget class="QLabel" name="sdkWarningLabel"> <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="text"> - <string><a href="xx">The GDB in the NDK appears to have broken python support.</a></string> + <string/> + </property> + <property name="wordWrap"> + <bool>true</bool> </property> </widget> </item> </layout> </item> - <item row="0" column="2"> - <widget class="QToolButton" name="downloadOpenJDKToolButton"> - <property name="toolTip"> - <string>Download JDK</string> - </property> - <property name="icon"> - <iconset resource="android.qrc"> - <normaloff>:/android/images/download.png</normaloff>:/android/images/download.png</iconset> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="SDKLocationLabel"> + <item row="0" column="0"> + <widget class="QLabel" name="OpenJDKLocationLabel"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="text"> - <string>Android SDK location:</string> + <string>JDK location:</string> </property> <property name="alignment"> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |