diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index b24f3e379c7..84b9b539159 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index d702a7c18a6..8e27b28f4c6 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -42,7 +42,6 @@ #include #include #include -#include #include #include #include diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp index cc48c1b027f..9614f858171 100644 --- a/src/plugins/qmljstools/qmljsmodelmanager.cpp +++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp @@ -116,9 +116,7 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject( } if (projectInfo.tryQmlDump) { - ToolChain *toolChain = ToolChainKitInformation::toolChain(activeKit); - QtSupport::QmlDumpTool::pathAndEnvironment(project, qtVersion, - toolChain, + QtSupport::QmlDumpTool::pathAndEnvironment(qtVersion, preferDebugDump, &projectInfo.qmlDumpPath, &projectInfo.qmlDumpEnvironment); projectInfo.qmlDumpHasRelocatableFlag = qtVersion->hasQmlDumpWithRelocatableFlag(); diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 67193bdaa36..71c7533504c 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -37,7 +37,6 @@ #include #include #include -#include #include #include diff --git a/src/plugins/qtsupport/debugginghelper.ui b/src/plugins/qtsupport/debugginghelper.ui deleted file mode 100644 index 87f7a168c11..00000000000 --- a/src/plugins/qtsupport/debugginghelper.ui +++ /dev/null @@ -1,112 +0,0 @@ - - - QtSupport::Internal::DebuggingHelper - - - - 0 - 0 - 330 - 85 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - Build - - - - - - - Used to extract QML type information from library-based plugins. - - - QML Dump: - - - - - - - - 2 - 0 - - - - TextLabel - - - - - - - - - - - Compiler: - - - - - - - QComboBox::AdjustToContents - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Show compiler output of last build. - - - Show Log - - - - - - - Build All - - - - - - - - - - diff --git a/src/plugins/qtsupport/debugginghelperbuildtask.cpp b/src/plugins/qtsupport/debugginghelperbuildtask.cpp deleted file mode 100644 index 777c6037cc3..00000000000 --- a/src/plugins/qtsupport/debugginghelperbuildtask.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#include "debugginghelperbuildtask.h" -#include "qmldumptool.h" -#include "baseqtversion.h" -#include "qtversionmanager.h" -#include -#include - -#include - -using namespace QtSupport; -using namespace QtSupport::Internal; -using namespace QtSupport::Internal; -using namespace ProjectExplorer; - -DebuggingHelperBuildTask::DebuggingHelperBuildTask(const BaseQtVersion *version, - const ToolChain *toolChain, - Tools tools) : - m_tools(tools & availableTools(version)), - m_invalidQt(false), - m_showErrors(true) -{ - if (!version || !version->isValid() || !toolChain) { - m_invalidQt = true; - return; - } - // allow type to be used in queued connections. - qRegisterMetaType("DebuggingHelperBuildTask::Tools"); - - // Print result in application ouptut - connect(this, SIGNAL(logOutput(QString,Core::MessageManager::PrintToOutputPaneFlags)), - Core::MessageManager::instance(), SLOT(write(QString,Core::MessageManager::PrintToOutputPaneFlags)), - Qt::QueuedConnection); - - // - // Extract all information we need from version, such that we don't depend on the existence - // of the version pointer while compiling - // - m_qtId = version->uniqueId(); - m_qtInstallData = version->qmakeProperty("QT_INSTALL_DATA"); - if (m_qtInstallData.isEmpty()) { - const QString error - = QCoreApplication::translate( - "QtVersion", - "Cannot determine the installation path for Qt version \"%1\"." - ).arg(version->displayName()); - log(QString(), error); - m_invalidQt = true; - return; - } - - m_environment = Utils::Environment::systemEnvironment(); -#if 0 // FIXME: Reenable this! - version->addToEnvironment(m_environment); -#endif - - toolChain->addToEnvironment(m_environment); - - log(QCoreApplication::translate("QtVersion", "Building helper(s) with toolchain \"%1\"...\n" - ).arg(toolChain->displayName()), QString()); - - if (toolChain->targetAbi().os() == Abi::LinuxOS - && Abi::hostAbi().os() == Abi::WindowsOS) - m_target = QLatin1String("-unix"); - m_makeArguments << QLatin1String("all") - << QLatin1String("-k"); - m_qmakeCommand = version->qmakeCommand(); - m_qmakeArguments = QStringList() << QLatin1String("-nocache"); - if (toolChain->targetAbi().os() == Abi::MacOS - && toolChain->targetAbi().architecture() == Abi::X86Architecture) { - // explicitly set 32 or 64 bit in case Qt is compiled with both - if (toolChain->targetAbi().wordWidth() == 32) - m_qmakeArguments << QLatin1String("CONFIG+=x86"); - else if (toolChain->targetAbi().wordWidth() == 64) - m_qmakeArguments << QLatin1String("CONFIG+=x86_64"); - } - m_makeCommand = toolChain->makeCommand(m_environment); - m_mkspec = version->mkspec(); - - // Make sure QtVersion cache is invalidated - connect(this, SIGNAL(updateQtVersions(Utils::FileName)), - QtVersionManager::instance(), SLOT(updateDumpFor(Utils::FileName)), - Qt::QueuedConnection); -} - - -DebuggingHelperBuildTask::Tools DebuggingHelperBuildTask::availableTools(const BaseQtVersion *version) -{ - QTC_ASSERT(version, return 0); - // Check the build requirements of the tools - DebuggingHelperBuildTask::Tools tools = 0; - if (QmlDumpTool::canBuild(version)) - tools |= QmlDump; - return tools; -} - -void DebuggingHelperBuildTask::showOutputOnError(bool show) -{ - m_showErrors = show; -} - -void DebuggingHelperBuildTask::run(QFutureInterface &future) -{ - future.setProgressRange(0, 3); - future.setProgressValue(1); - - if (m_invalidQt || !buildDebuggingHelper(future)) { - const QString error - = QCoreApplication::translate( - "QtVersion", - "Build failed."); - log(QString(), error); - } else { - const QString result - = QCoreApplication::translate( - "QtVersion", - "Build succeeded."); - log(result, QString()); - } - - emit finished(m_qtId, m_log, m_tools); - emit updateQtVersions(m_qmakeCommand); - deleteLater(); -} - -bool DebuggingHelperBuildTask::buildDebuggingHelper(QFutureInterface &future) -{ - Utils::BuildableHelperLibrary::BuildHelperArguments arguments; - arguments.makeCommand = m_makeCommand; - arguments.makeArguments = m_makeArguments; - arguments.qmakeCommand = m_qmakeCommand; - arguments.qmakeArguments = m_qmakeArguments; - arguments.targetMode = m_target; - arguments.mkspec = m_mkspec; - arguments.environment = m_environment; - - future.setProgressValue(2); - - if (m_tools & QmlDump) { - QString output, error; - bool success = true; - - arguments.directory = QmlDumpTool::copy(m_qtInstallData, &error); - if (arguments.directory.isEmpty() - || !QmlDumpTool::build(arguments, &output, &error)) - success = false; - log(output, error); - if (!success) - return false; - } - future.setProgressValue(3); - return true; -} - -void DebuggingHelperBuildTask::log(const QString &output, const QString &error) -{ - if (output.isEmpty() && error.isEmpty()) - return; - - QString logEntry; - if (!output.isEmpty()) - logEntry.append(output); - if (!error.isEmpty()) - logEntry.append(error); - m_log.append(logEntry); - - Core::MessageManager::PrintToOutputPaneFlags flag = Core::MessageManager::Silent; - if (m_showErrors && !error.isEmpty()) - flag = Core::MessageManager::NoModeSwitch; - - emit logOutput(logEntry, flag); -} diff --git a/src/plugins/qtsupport/debugginghelperbuildtask.h b/src/plugins/qtsupport/debugginghelperbuildtask.h deleted file mode 100644 index c7c6e446553..00000000000 --- a/src/plugins/qtsupport/debugginghelperbuildtask.h +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#ifndef DEBUGGINGHELPERBUILDTASK_H -#define DEBUGGINGHELPERBUILDTASK_H - -#include "qtsupport_global.h" -#include -#include -#include - -#include -#include -#include - -namespace ProjectExplorer { class ToolChain; } - -namespace QtSupport { - -class BaseQtVersion; - -class QTSUPPORT_EXPORT DebuggingHelperBuildTask : public QObject -{ - Q_OBJECT - -public: - enum DebuggingHelper { - QmlDump = 0x02, - AllTools = QmlDump - }; - Q_DECLARE_FLAGS(Tools, DebuggingHelper) - - explicit DebuggingHelperBuildTask(const BaseQtVersion *version, - const ProjectExplorer::ToolChain *toolChain, - Tools tools = AllTools); - - void showOutputOnError(bool show); - void run(QFutureInterface &future); - - static Tools availableTools(const BaseQtVersion *version); - -signals: - void finished(int qtVersionId, const QString &output, DebuggingHelperBuildTask::Tools tools); - - // used internally - void logOutput(const QString &output, Core::MessageManager::PrintToOutputPaneFlags flags); - void updateQtVersions(const Utils::FileName &qmakeCommand); - -private: - bool buildDebuggingHelper(QFutureInterface &future); - void log(const QString &output, const QString &error); - - const Tools m_tools; - - int m_qtId; - QString m_qtInstallData; - QString m_target; - Utils::FileName m_qmakeCommand; - QStringList m_qmakeArguments; - QString m_makeCommand; - QStringList m_makeArguments; - Utils::FileName m_mkspec; - Utils::Environment m_environment; - QString m_log; - bool m_invalidQt; - bool m_showErrors; -}; - -} // namespace QtSupport - -Q_DECLARE_METATYPE(QtSupport::DebuggingHelperBuildTask::Tools) - -#endif // DEBUGGINGHELPERBUILDTASK_H diff --git a/src/plugins/qtsupport/qmldumptool.cpp b/src/plugins/qtsupport/qmldumptool.cpp index f1a03ea8a26..60777ac2124 100644 --- a/src/plugins/qtsupport/qmldumptool.cpp +++ b/src/plugins/qtsupport/qmldumptool.cpp @@ -26,7 +26,6 @@ #include "qmldumptool.h" #include "qtsupportconstants.h" #include "qtversionmanager.h" -#include "debugginghelperbuildtask.h" #include #include @@ -43,118 +42,6 @@ #include #include -namespace { - -using namespace QtSupport; -using namespace ProjectExplorer; - -class QmlDumpBuildTask; - -typedef QHash QmlDumpByVersion; -Q_GLOBAL_STATIC(QmlDumpByVersion, qmlDumpBuilds) - -// A task suitable to be run by QtConcurrent to build qmldump. -class QmlDumpBuildTask : public QObject -{ - Q_OBJECT - -public: - explicit QmlDumpBuildTask(BaseQtVersion *version, ToolChain *toolChain) - : m_buildTask(new DebuggingHelperBuildTask(version, toolChain, - DebuggingHelperBuildTask::QmlDump)) - , m_failed(false) - { - qmlDumpBuilds()->insert(version->uniqueId(), this); - // Don't open General Messages pane with errors - m_buildTask->showOutputOnError(false); - connect(m_buildTask, SIGNAL(finished(int,QString,DebuggingHelperBuildTask::Tools)), - this, SLOT(finish(int,QString,DebuggingHelperBuildTask::Tools)), - Qt::QueuedConnection); - } - - void run(QFutureInterface &future) - { - m_buildTask->run(future); - } - - void updateProjectWhenDone(QPointer project, bool preferDebug) - { - foreach (const ProjectToUpdate &update, m_projectsToUpdate) { - if (update.project == project) - return; - } - - ProjectToUpdate update; - update.project = project; - update.preferDebug = preferDebug; - m_projectsToUpdate += update; - } - - bool hasFailed() const - { - return m_failed; - } - -private slots: - void finish(int qtId, const QString &output, DebuggingHelperBuildTask::Tools tools) - { - BaseQtVersion *version = QtVersionManager::version(qtId); - - QTC_ASSERT(tools == DebuggingHelperBuildTask::QmlDump, return); - QString errorMessage; - if (!version) { - m_failed = true; - errorMessage = QString::fromLatin1("Qt version became invalid"); - } else { - if (!version->hasQmlDump()) { - m_failed = true; - errorMessage = QString::fromLatin1("Could not build QML plugin dumping helper for %1\n" - "Output:\n%2"). - arg(version->displayName(), output); - } - } - - if (m_failed) { - qWarning("%s", qPrintable(errorMessage)); - return; - } - - // update qmldump path for all the project - QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance(); - if (!modelManager) - return; - - foreach (const ProjectToUpdate &update, m_projectsToUpdate) { - if (!update.project) - continue; - QmlJS::ModelManagerInterface::ProjectInfo projectInfo = modelManager->projectInfo(update.project); - projectInfo.qmlDumpPath = version->qmlDumpTool(update.preferDebug); - if (projectInfo.qmlDumpPath.isEmpty()) - projectInfo.qmlDumpPath = version->qmlDumpTool(!update.preferDebug); - projectInfo.qmlDumpEnvironment = version->qmlToolsEnvironment(); - projectInfo.qmlDumpHasRelocatableFlag = version->hasQmlDumpWithRelocatableFlag(); - modelManager->updateProjectInfo(projectInfo, update.project); - } - - // clean up - qmlDumpBuilds()->remove(qtId); - deleteLater(); - } - -private: - class ProjectToUpdate { - public: - QPointer project; - bool preferDebug; - }; - - QList m_projectsToUpdate; - DebuggingHelperBuildTask *m_buildTask; // deletes itself after run() - bool m_failed; -}; -} // end of anonymous namespace - - namespace QtSupport { static inline QStringList validBinaryFilenames(bool debugBuild) @@ -311,25 +198,13 @@ QStringList QmlDumpTool::installDirectories(const QString &qtInstallData) return directories; } -void QmlDumpTool::pathAndEnvironment(Project *project, BaseQtVersion *version, - ToolChain *toolChain, +void QmlDumpTool::pathAndEnvironment(BaseQtVersion *version, bool preferDebug, QString *dumperPath, Utils::Environment *env) { - QString path; - if (version && !version->hasQmlDump() && QmlDumpTool::canBuild(version)) { - QmlDumpBuildTask *qmlDumpBuildTask = qmlDumpBuilds()->value(version->uniqueId()); - if (qmlDumpBuildTask) { - if (!qmlDumpBuildTask->hasFailed()) - qmlDumpBuildTask->updateProjectWhenDone(project, preferDebug); - } else { - QmlDumpBuildTask *buildTask = new QmlDumpBuildTask(version, toolChain); - buildTask->updateProjectWhenDone(project, preferDebug); - QFuture task = QtConcurrent::run(&QmlDumpBuildTask::run, buildTask); - const QString taskName = QmlDumpBuildTask::tr("Building QML Helpers"); - Core::ProgressManager::addTask(task, taskName, "QmakeProjectManager::BuildHelpers"); - } + if (version && !version->hasQmlDump()) return; - } + + QString path; path = toolForVersion(version, preferDebug); if (path.isEmpty()) @@ -354,4 +229,3 @@ void QmlDumpTool::pathAndEnvironment(Project *project, BaseQtVersion *version, } // namespace QtSupport -#include "qmldumptool.moc" diff --git a/src/plugins/qtsupport/qmldumptool.h b/src/plugins/qtsupport/qmldumptool.h index 7f00d4ad778..1458021f130 100644 --- a/src/plugins/qtsupport/qmldumptool.h +++ b/src/plugins/qtsupport/qmldumptool.h @@ -57,8 +57,7 @@ public: // Copy the source files to a target location and return the chosen target location. static QString copy(const QString &qtInstallData, QString *errorMessage); - static void pathAndEnvironment(ProjectExplorer::Project *project, BaseQtVersion *version, - ProjectExplorer::ToolChain *toolChain, + static void pathAndEnvironment(BaseQtVersion *version, bool preferDebug, QString *path, Utils::Environment *env); private: diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index ad99bb538f4..773e89c529a 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -28,11 +28,9 @@ #include "ui_showbuildlog.h" #include "ui_qtversionmanager.h" #include "ui_qtversioninfo.h" -#include "ui_debugginghelper.h" #include "qtsupportconstants.h" #include "qtversionmanager.h" #include "qtversionfactory.h" -#include "qmldumptool.h" #include #include @@ -41,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -140,22 +139,11 @@ public: m_toolChainId = id; } - DebuggingHelperBuildTask::Tools buildFlags() const - { - return m_buildFlags; - } - - void setBuildFlags(DebuggingHelperBuildTask::Tools flags) - { - m_buildFlags = flags; - } - private: BaseQtVersion *m_version = 0; QIcon m_icon; QString m_buildLog; QByteArray m_toolChainId; - DebuggingHelperBuildTask::Tools m_buildFlags; }; /// @@ -200,7 +188,6 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent) , m_specifyNameString(tr("")) , m_ui(new Internal::Ui::QtVersionManager()) , m_versionUi(new Internal::Ui::QtVersionInfo()) - , m_debuggingHelperUi(new Internal::Ui::DebuggingHelper()) , m_infoBrowser(new QTextBrowser) , m_invalidVersionIcon(Core::Icons::ERROR.icon()) , m_warningVersionIcon(Core::Icons::WARNING.icon()) @@ -212,9 +199,6 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent) m_versionUi->setupUi(versionInfoWidget); m_versionUi->editPathPushButton->setText(PathChooser::browseButtonLabel()); - QWidget *debuggingHelperDetailsWidget = new QWidget(); - m_debuggingHelperUi->setupUi(debuggingHelperDetailsWidget); - m_ui->setupUi(this); m_infoBrowser->setOpenLinks(false); @@ -228,10 +212,6 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent) m_ui->versionInfoWidget->setWidget(versionInfoWidget); m_ui->versionInfoWidget->setState(DetailsWidget::NoSummary); - m_ui->debuggingHelperWidget->setWidget(debuggingHelperDetailsWidget); - connect(m_ui->debuggingHelperWidget, &DetailsWidget::expanded, - this, &QtOptionsPageWidget::setInfoWidgetVisibility); - auto rootItem = new QtVersionItem(QLatin1String("root")); m_autoItem = new QtVersionItem(tr("Auto-detected")); rootItem->appendChild(m_autoItem); @@ -277,16 +257,6 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent) connect(m_ui->qtdirList->selectionModel(), &QItemSelectionModel::currentChanged, this, &QtOptionsPageWidget::versionChanged); - connect(m_debuggingHelperUi->rebuildButton, &QAbstractButton::clicked, - this, [this]() { buildDebuggingHelper(); }); - connect(m_debuggingHelperUi->qmlDumpBuildButton, &QAbstractButton::clicked, - this, &QtOptionsPageWidget::buildQmlDump); - - connect(m_debuggingHelperUi->showLogButton, &QAbstractButton::clicked, - this, &QtOptionsPageWidget::slotShowDebuggingBuildLog); - connect(m_debuggingHelperUi->toolChainComboBox, static_cast(&QComboBox::activated), - this, &QtOptionsPageWidget::selectedToolChainChanged); - connect(m_ui->cleanUpButton, &QAbstractButton::clicked, this, &QtOptionsPageWidget::cleanUpQtVersions); userChangedCurrentVersion(); @@ -326,41 +296,6 @@ QtVersionItem *QtOptionsPageWidget::currentItem() const return item; } -// Update with results of terminated helper build -void QtOptionsPageWidget::debuggingHelperBuildFinished(int qtVersionId, const QString &output, DebuggingHelperBuildTask::Tools tools) -{ - auto findItem = [qtVersionId](Utils::TreeItem *parent) { - foreach (Utils::TreeItem *child, parent->children()) { - auto item = static_cast(child); - if (item->version()->uniqueId() == qtVersionId) - return item; - } - return (QtVersionItem *)nullptr; - }; - - QtVersionItem *item = findItem(m_manualItem); - if (!item) - item = findItem(m_autoItem); - - if (!item) - return; - - - DebuggingHelperBuildTask::Tools buildFlags = item->buildFlags(); - buildFlags &= ~tools; - item->setBuildFlags(buildFlags); - item->setBuildLog(output); - - bool success = true; - if (tools & DebuggingHelperBuildTask::QmlDump) - success &= item->version()->hasQmlDump(); - - if (!success) - showDebuggingBuildLog(item); - - updateDebuggingHelperUi(); -} - void QtOptionsPageWidget::cleanUpQtVersions() { QVector toRemove; @@ -401,7 +336,6 @@ void QtOptionsPageWidget::toolChainsUpdated() foreach (Utils::TreeItem *child, parent->children()) { if (child == currentItem()) { updateDescriptionLabel(); - updateDebuggingHelperUi(); } else { updateVersionItem(static_cast(child)); } @@ -412,16 +346,6 @@ void QtOptionsPageWidget::toolChainsUpdated() update(m_manualItem); } -void QtOptionsPageWidget::selectedToolChainChanged(int comboIndex) -{ - QtVersionItem *item = currentItem(); - if (!item) - return; - - QByteArray toolChainId = m_debuggingHelperUi->toolChainComboBox->itemData(comboIndex).toByteArray(); - item->setToolChainId(toolChainId); -} - void QtOptionsPageWidget::qtVersionsDumpUpdated(const FileName &qmakeCommand) { auto recheck = [qmakeCommand](Utils::TreeItem *parent) { @@ -439,16 +363,13 @@ void QtOptionsPageWidget::qtVersionsDumpUpdated(const FileName &qmakeCommand) && currentVersion()->qmakeCommand() == qmakeCommand) { updateWidgets(); updateDescriptionLabel(); - updateDebuggingHelperUi(); } } void QtOptionsPageWidget::setInfoWidgetVisibility() { - m_ui->versionInfoWidget->setVisible((m_ui->infoWidget->state() == DetailsWidget::Collapsed) - && (m_ui->debuggingHelperWidget->state() == DetailsWidget::Collapsed)); - m_ui->infoWidget->setVisible(m_ui->debuggingHelperWidget->state() == DetailsWidget::Collapsed); - m_ui->debuggingHelperWidget->setVisible(m_ui->infoWidget->state() == DetailsWidget::Collapsed); + m_ui->versionInfoWidget->setVisible(m_ui->infoWidget->state() == DetailsWidget::Collapsed); + m_ui->infoWidget->setVisible(true); } void QtOptionsPageWidget::infoAnchorClicked(const QUrl &url) @@ -568,48 +489,6 @@ void QtOptionsPageWidget::updateVersionItem(QtVersionItem *item) item->setIcon(info.icon); } -void QtOptionsPageWidget::buildDebuggingHelper(DebuggingHelperBuildTask::Tools tools) -{ - QtVersionItem *item = currentItem(); - if (!item) - return; - - if (!item->version()) - return; - - // remove tools that cannot be build - tools &= DebuggingHelperBuildTask::availableTools(currentVersion()); - - DebuggingHelperBuildTask::Tools buildFlags = item->buildFlags(); - buildFlags |= tools; - item->setBuildFlags(buildFlags); - - updateDebuggingHelperUi(); - - // Run a debugging helper build task in the background. - QByteArray toolChainId = m_debuggingHelperUi->toolChainComboBox->itemData( - m_debuggingHelperUi->toolChainComboBox->currentIndex()).toByteArray(); - ToolChain *toolChain = ToolChainManager::findToolChain(toolChainId); - if (!toolChain) - return; - - DebuggingHelperBuildTask *buildTask = new DebuggingHelperBuildTask(item->version(), toolChain, tools); - // Don't open General Messages pane with errors - buildTask->showOutputOnError(false); - connect(buildTask, SIGNAL(finished(int,QString,DebuggingHelperBuildTask::Tools)), - this, SLOT(debuggingHelperBuildFinished(int,QString,DebuggingHelperBuildTask::Tools)), - Qt::QueuedConnection); - QFuture task = QtConcurrent::run(&DebuggingHelperBuildTask::run, buildTask); - const QString taskName = tr("Building Helpers"); - - Core::ProgressManager::addTask(task, taskName, "QmakeProjectManager::BuildHelpers"); -} - -void QtOptionsPageWidget::buildQmlDump() -{ - buildDebuggingHelper(DebuggingHelperBuildTask::QmlDump); -} - // Non-modal dialog class BuildLogDialog : public QDialog { public: @@ -633,12 +512,6 @@ void BuildLogDialog::setText(const QString &text) m_ui.log->ensureCursorVisible(); } -void QtOptionsPageWidget::slotShowDebuggingBuildLog() -{ - if (const QtVersionItem *item = currentItem()) - showDebuggingBuildLog(item); -} - void QtOptionsPageWidget::showDebuggingBuildLog(const QtVersionItem *item) { BaseQtVersion *version = item->version(); @@ -709,7 +582,6 @@ QtOptionsPageWidget::~QtOptionsPageWidget() { delete m_ui; delete m_versionUi; - delete m_debuggingHelperUi; delete m_configurationWidget; } @@ -826,98 +698,6 @@ void QtOptionsPageWidget::editPath() delete current; } -void QtOptionsPageWidget::updateDebuggingHelperUi() -{ - BaseQtVersion *version = currentVersion(); - const QtVersionItem *item = currentItem(); - - QList toolchains = toolChains(currentVersion()); - - if (!version || !version->isValid() || toolchains.isEmpty()) { - m_ui->debuggingHelperWidget->setVisible(false); - } else { - const DebuggingHelperBuildTask::Tools availableTools = DebuggingHelperBuildTask::availableTools(version); - const bool canBuildQmlDumper = availableTools & DebuggingHelperBuildTask::QmlDump; - - const bool hasQmlDumper = version->hasQmlDump(); - const bool needsQmlDumper = version->needsQmlDump(); - - bool isBuildingQmlDumper = false; - - if (item) { - DebuggingHelperBuildTask::Tools buildingTools = item->buildFlags(); - isBuildingQmlDumper = buildingTools & DebuggingHelperBuildTask::QmlDump; - } - - // get names of tools from labels - QStringList helperNames; - const QChar colon = QLatin1Char(':'); - if (hasQmlDumper) - helperNames << m_debuggingHelperUi->qmlDumpLabel->text().remove(colon); - - QString status; - if (helperNames.isEmpty()) { - status = tr("Helpers: None available"); - } else { - //: %1 is list of tool names. - status = tr("Helpers: %1.").arg(helperNames.join(QLatin1String(", "))); - } - - m_ui->debuggingHelperWidget->setSummaryText(status); - - QString qmlDumpStatusText, qmlDumpStatusToolTip; - Qt::TextInteractionFlags qmlDumpStatusTextFlags = Qt::NoTextInteraction; - if (hasQmlDumper) { - qmlDumpStatusText = QDir::toNativeSeparators(version->qmlDumpTool(false)); - const QString debugQmlDumpPath = QDir::toNativeSeparators(version->qmlDumpTool(true)); - if (qmlDumpStatusText != debugQmlDumpPath) { - if (!qmlDumpStatusText.isEmpty() - && !debugQmlDumpPath.isEmpty()) - qmlDumpStatusText += QLatin1String("\n"); - qmlDumpStatusText += debugQmlDumpPath; - } - qmlDumpStatusTextFlags = Qt::TextSelectableByMouse; - } else { - if (!needsQmlDumper) { - qmlDumpStatusText = tr("Not needed."); - } else if (canBuildQmlDumper) { - qmlDumpStatusText = tr("Not yet built."); - } else { - qmlDumpStatusText = tr("Cannot be compiled."); - QmlDumpTool::canBuild(version, &qmlDumpStatusToolTip); - } - } - m_debuggingHelperUi->qmlDumpStatus->setText(qmlDumpStatusText); - m_debuggingHelperUi->qmlDumpStatus->setTextInteractionFlags(qmlDumpStatusTextFlags); - m_debuggingHelperUi->qmlDumpStatus->setToolTip(qmlDumpStatusToolTip); - m_debuggingHelperUi->qmlDumpBuildButton->setEnabled(canBuildQmlDumper & !isBuildingQmlDumper); - - QList toolchains = toolChains(currentVersion()); - QByteArray selectedToolChainId = item->toolChainId(); - m_debuggingHelperUi->toolChainComboBox->clear(); - for (int i = 0; i < toolchains.size(); ++i) { - if (!toolchains.at(i)->isValid()) - continue; - if (i >= m_debuggingHelperUi->toolChainComboBox->count()) { - m_debuggingHelperUi->toolChainComboBox->insertItem(i, toolchains.at(i)->displayName(), - toolchains.at(i)->id()); - } - if (toolchains.at(i)->id() == selectedToolChainId) - m_debuggingHelperUi->toolChainComboBox->setCurrentIndex(i); - } - - const bool hasLog = item && !item->buildLog().isEmpty(); - m_debuggingHelperUi->showLogButton->setEnabled(hasLog); - - const bool canBuild = canBuildQmlDumper; - const bool isBuilding = isBuildingQmlDumper; - - m_debuggingHelperUi->rebuildButton->setEnabled(canBuild && !isBuilding); - m_debuggingHelperUi->toolChainComboBox->setEnabled(canBuild && !isBuilding); - setInfoWidgetVisibility(); - } -} - // To be called if a Qt version was removed or added void QtOptionsPageWidget::updateCleanUpButton() { @@ -937,13 +717,11 @@ void QtOptionsPageWidget::userChangedCurrentVersion() { updateWidgets(); updateDescriptionLabel(); - updateDebuggingHelperUi(); } void QtOptionsPageWidget::qtVersionChanged() { updateDescriptionLabel(); - updateDebuggingHelperUi(); } void QtOptionsPageWidget::updateDescriptionLabel() @@ -969,7 +747,6 @@ void QtOptionsPageWidget::updateDescriptionLabel() m_infoBrowser->clear(); m_ui->versionInfoWidget->setVisible(false); m_ui->infoWidget->setVisible(false); - m_ui->debuggingHelperWidget->setVisible(false); } } diff --git a/src/plugins/qtsupport/qtoptionspage.h b/src/plugins/qtsupport/qtoptionspage.h index 81c9d20b0c8..710f5f37aed 100644 --- a/src/plugins/qtsupport/qtoptionspage.h +++ b/src/plugins/qtsupport/qtoptionspage.h @@ -26,8 +26,8 @@ #ifndef QTOPTIONSPAGE_H #define QTOPTIONSPAGE_H -#include "debugginghelperbuildtask.h" #include +#include #include #include @@ -56,7 +56,6 @@ class QtVersionItem; namespace Ui { class QtVersionManager; class QtVersionInfo; -class DebuggingHelper; } class QtOptionsPageWidget : public QWidget @@ -73,7 +72,6 @@ private: void updateDescriptionLabel(); void userChangedCurrentVersion(); void updateWidgets(); - void updateDebuggingHelperUi(); BaseQtVersion *currentVersion() const; QtVersionItem *currentItem() const; void showDebuggingBuildLog(const QtVersionItem *item); @@ -82,7 +80,6 @@ private: Internal::Ui::QtVersionManager *m_ui; Internal::Ui::QtVersionInfo *m_versionUi; - Internal::Ui::DebuggingHelper *m_debuggingHelperUi; QTextBrowser *m_infoBrowser; int m_defaultVersion; QIcon m_invalidVersionIcon; @@ -99,15 +96,9 @@ private slots: void editPath(); void updateCleanUpButton(); void updateCurrentQtName(); - void buildDebuggingHelper(DebuggingHelperBuildTask::Tools tools - = DebuggingHelperBuildTask::AllTools); - void buildQmlDump(); - void slotShowDebuggingBuildLog(); - void debuggingHelperBuildFinished(int qtVersionId, const QString &output, - DebuggingHelperBuildTask::Tools tools); + void cleanUpQtVersions(); void toolChainsUpdated(); - void selectedToolChainChanged(int index); void qtVersionsDumpUpdated(const Utils::FileName &qmakeCommand); void setInfoWidgetVisibility(); diff --git a/src/plugins/qtsupport/qtsupport.pro b/src/plugins/qtsupport/qtsupport.pro index d88624a2b02..eb692d264da 100644 --- a/src/plugins/qtsupport/qtsupport.pro +++ b/src/plugins/qtsupport/qtsupport.pro @@ -24,7 +24,6 @@ HEADERS += \ qtoptionspage.h \ customexecutablerunconfiguration.h \ customexecutableconfigurationwidget.h \ - debugginghelperbuildtask.h \ qtsupportconstants.h \ profilereader.h \ qtparser.h \ @@ -53,7 +52,6 @@ SOURCES += \ qtoptionspage.cpp \ customexecutablerunconfiguration.cpp \ customexecutableconfigurationwidget.cpp \ - debugginghelperbuildtask.cpp \ profilereader.cpp \ qtparser.cpp \ exampleslistmodel.cpp \ @@ -68,7 +66,6 @@ FORMS += \ codegensettingspagewidget.ui \ showbuildlog.ui \ qtversioninfo.ui \ - debugginghelper.ui \ qtversionmanager.ui \ RESOURCES += \ diff --git a/src/plugins/qtsupport/qtsupport.qbs b/src/plugins/qtsupport/qtsupport.qbs index 038d9a43421..6d7d8d5f088 100644 --- a/src/plugins/qtsupport/qtsupport.qbs +++ b/src/plugins/qtsupport/qtsupport.qbs @@ -69,9 +69,6 @@ QtcPlugin { "customexecutableconfigurationwidget.h", "customexecutablerunconfiguration.cpp", "customexecutablerunconfiguration.h", - "debugginghelper.ui", - "debugginghelperbuildtask.cpp", - "debugginghelperbuildtask.h", "exampleslistmodel.cpp", "exampleslistmodel.h", "profilereader.cpp", diff --git a/src/plugins/qtsupport/qtversionmanager.ui b/src/plugins/qtsupport/qtversionmanager.ui index db5d5f0c0ad..3d185a59a63 100644 --- a/src/plugins/qtsupport/qtversionmanager.ui +++ b/src/plugins/qtsupport/qtversionmanager.ui @@ -26,9 +26,6 @@ - - -