From 5a79945ef6a7e43b01e1d60ff4db614439e1091a Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 16 May 2012 16:24:16 +0200 Subject: DebuggingHelper: Move to QtSupport * Move debugginghelper to QtSupport. ProjectExplorer should not start looking for Qt versions! * Make autotools and generic project plugins depend on QtSupport Change-Id: If28418a85e3696cba713e66148c893a5a9b6adc7 Reviewed-by: Daniel Teske --- src/plugins/android/androidtarget.cpp | 4 +- src/plugins/android/androidtargetfactory.cpp | 4 +- .../AutotoolsProjectManager.pluginspec.in | 1 + .../autotoolsbuildconfiguration.cpp | 4 +- .../autotoolsprojectmanager_dependencies.pri | 1 + .../autotoolsprojectmanager/autotoolstarget.cpp | 4 +- .../CMakeProjectManager.pluginspec.in | 1 + .../cmakeprojectmanager/cmakeprojectmanager.qbs | 1 + .../cmakeprojectmanager_dependencies.pri | 1 + .../cmakeprojectmanager/cmakerunconfiguration.cpp | 14 +- src/plugins/cmakeprojectmanager/cmaketarget.cpp | 9 +- src/plugins/debugger/debuggerrunner.cpp | 1 - .../GenericProjectManager.pluginspec.in | 1 + .../genericprojectmanager/genericproject.cpp | 4 +- .../genericprojectmanager.qbs | 1 + .../genericprojectmanager_dependencies.pri | 1 + .../genericprojectmanager/generictarget.cpp | 4 +- src/plugins/madde/qt4maemotarget.cpp | 4 +- src/plugins/madde/qt4maemotargetfactory.cpp | 4 +- src/plugins/plugins.pro | 3 + .../customexecutableconfigurationwidget.cpp | 216 ----------- .../customexecutableconfigurationwidget.h | 93 ----- .../customexecutablerunconfiguration.cpp | 417 -------------------- .../customexecutablerunconfiguration.h | 153 -------- src/plugins/projectexplorer/debugginghelper.cpp | 122 ------ src/plugins/projectexplorer/debugginghelper.h | 61 --- src/plugins/projectexplorer/projectexplorer.cpp | 2 - src/plugins/projectexplorer/projectexplorer.pro | 6 - src/plugins/projectexplorer/projectexplorer.qbs | 6 - .../qt-desktop/desktopqtversionfactory.cpp | 1 - .../qt-desktop/qt4desktoptarget.cpp | 4 +- .../qt-desktop/qt4desktoptargetfactory.cpp | 4 +- .../qt-desktop/qt4runconfiguration.h | 4 +- .../qt-desktop/qt4simulatortarget.cpp | 4 +- .../qt-desktop/qt4simulatortargetfactory.cpp | 4 +- .../qt4projectmanager/qt-s60/qt4symbiantarget.cpp | 4 +- .../qt-s60/qt4symbiantargetfactory.cpp | 4 +- src/plugins/qt4projectmanager/qt4project.cpp | 2 +- src/plugins/qt4projectmanager/qt4target.cpp | 6 +- src/plugins/qtsupport/baseqtversion.cpp | 8 +- .../customexecutableconfigurationwidget.cpp | 217 +++++++++++ .../customexecutableconfigurationwidget.h | 93 +++++ .../qtsupport/customexecutablerunconfiguration.cpp | 424 +++++++++++++++++++++ .../qtsupport/customexecutablerunconfiguration.h | 155 ++++++++ src/plugins/qtsupport/debugginghelper.cpp | 122 ++++++ src/plugins/qtsupport/debugginghelper.h | 61 +++ src/plugins/qtsupport/debugginghelperbuildtask.cpp | 2 +- src/plugins/qtsupport/qtsupport.pro | 6 + src/plugins/qtsupport/qtsupport.qbs | 6 + src/plugins/qtsupport/qtsupportplugin.cpp | 3 + src/plugins/qtsupport/qtversionmanager.cpp | 6 +- .../remotelinux/embeddedlinuxtargetfactory.cpp | 5 +- .../remotelinux/genericembeddedlinuxtarget.cpp | 4 +- 53 files changed, 1154 insertions(+), 1138 deletions(-) delete mode 100644 src/plugins/projectexplorer/customexecutableconfigurationwidget.cpp delete mode 100644 src/plugins/projectexplorer/customexecutableconfigurationwidget.h delete mode 100644 src/plugins/projectexplorer/customexecutablerunconfiguration.cpp delete mode 100644 src/plugins/projectexplorer/customexecutablerunconfiguration.h delete mode 100644 src/plugins/projectexplorer/debugginghelper.cpp delete mode 100644 src/plugins/projectexplorer/debugginghelper.h create mode 100644 src/plugins/qtsupport/customexecutableconfigurationwidget.cpp create mode 100644 src/plugins/qtsupport/customexecutableconfigurationwidget.h create mode 100644 src/plugins/qtsupport/customexecutablerunconfiguration.cpp create mode 100644 src/plugins/qtsupport/customexecutablerunconfiguration.h create mode 100644 src/plugins/qtsupport/debugginghelper.cpp create mode 100644 src/plugins/qtsupport/debugginghelper.h (limited to 'src/plugins') diff --git a/src/plugins/android/androidtarget.cpp b/src/plugins/android/androidtarget.cpp index 2547c1d927..292b4ceaf3 100644 --- a/src/plugins/android/androidtarget.cpp +++ b/src/plugins/android/androidtarget.cpp @@ -38,12 +38,12 @@ #include "androidglobal.h" #include "androidpackagecreationstep.h" -#include #include #include #include #include #include +#include #include #include @@ -120,7 +120,7 @@ void AndroidTarget::createApplicationProFiles(bool reparse) // Oh still none? Add a custom executable runconfiguration if (runConfigurations().isEmpty()) { - addRunConfiguration(new ProjectExplorer::CustomExecutableRunConfiguration(this)); + addRunConfiguration(new QtSupport::CustomExecutableRunConfiguration(this)); } } diff --git a/src/plugins/android/androidtargetfactory.cpp b/src/plugins/android/androidtargetfactory.cpp index 2e4987a5d4..180aa851ba 100644 --- a/src/plugins/android/androidtargetfactory.cpp +++ b/src/plugins/android/androidtargetfactory.cpp @@ -42,8 +42,8 @@ #include #include -#include #include +#include #include @@ -173,7 +173,7 @@ Qt4BaseTarget *AndroidTargetFactory::create(ProjectExplorer::Project *parent, co target->createApplicationProFiles(false); if (target->runConfigurations().isEmpty()) - target->addRunConfiguration(new ProjectExplorer::CustomExecutableRunConfiguration(target)); + target->addRunConfiguration(new QtSupport::CustomExecutableRunConfiguration(target)); return target; } diff --git a/src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in b/src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in index 39a1ce145a..15467b7f04 100644 --- a/src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in +++ b/src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in @@ -18,6 +18,7 @@ + diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp index 44172b7109..d4a4fb2adb 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include @@ -173,7 +173,7 @@ AutotoolsBuildConfiguration *AutotoolsBuildConfigurationFactory::create(Target * t->addDeployConfiguration(t->createDeployConfiguration(Core::Id(DEFAULT_DEPLOYCONFIGURATION_ID))); // User needs to choose where the executable file is. // TODO: Parse the file in *Anjuta style* to be able to add custom RunConfigurations. - t->addRunConfiguration(new CustomExecutableRunConfiguration(t)); + t->addRunConfiguration(new QtSupport::CustomExecutableRunConfiguration(t)); return bc; } diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager_dependencies.pri b/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager_dependencies.pri index 614357cd4d..774680fda4 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager_dependencies.pri +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager_dependencies.pri @@ -1,3 +1,4 @@ include(../../plugins/projectexplorer/projectexplorer.pri) include(../../plugins/coreplugin/coreplugin.pri) include(../../plugins/cpptools/cpptools.pri) +include(../../plugins/qtsupport/qtsupport.pri) diff --git a/src/plugins/autotoolsprojectmanager/autotoolstarget.cpp b/src/plugins/autotoolsprojectmanager/autotoolstarget.cpp index c061fe9ac7..c7917e50b1 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolstarget.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolstarget.cpp @@ -42,9 +42,9 @@ #include "autoreconfstep.h" #include "configurestep.h" -#include #include #include +#include #include #include @@ -152,7 +152,7 @@ AutotoolsTarget *AutotoolsTargetFactory::create(Project *parent, const Core::Id t->addDeployConfiguration(t->createDeployConfiguration(Core::Id(ProjectExplorer::Constants::DEFAULT_DEPLOYCONFIGURATION_ID))); // User needs to choose where the executable file is. // TODO: Parse the file in *Anjuta style* to be able to add custom RunConfigurations. - t->addRunConfiguration(new CustomExecutableRunConfiguration(t)); + t->addRunConfiguration(new QtSupport::CustomExecutableRunConfiguration(t)); return t; } diff --git a/src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec.in b/src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec.in index f5590c5b76..1ee635c00a 100644 --- a/src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec.in +++ b/src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec.in @@ -17,6 +17,7 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General + diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs index 63b856dfc3..7af081a2ff 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs @@ -12,6 +12,7 @@ QtcPlugin { Depends { name: "CPlusPlus" } Depends { name: "TextEditor" } Depends { name: "Locator" } + Depends { name: "QtSupport" } Depends { name: "cpp" } cpp.includePaths: [ diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager_dependencies.pri b/src/plugins/cmakeprojectmanager/cmakeprojectmanager_dependencies.pri index 78430f853b..03f29efcdb 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager_dependencies.pri +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager_dependencies.pri @@ -1,3 +1,4 @@ include(../../plugins/projectexplorer/projectexplorer.pri) include(../../plugins/cpptools/cpptools.pri) include(../../plugins/texteditor/texteditor.pri) +include(../../plugins/qtsupport/qtsupport.pri) diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp index 005ab695c3..1f3f2f1c8d 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp @@ -39,7 +39,7 @@ #include #include -#include +#include #include #include @@ -242,17 +242,17 @@ void CMakeRunConfiguration::setCommandLineArguments(const QString &newText) QString CMakeRunConfiguration::dumperLibrary() const { - Utils::FileName qmakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(environment()); - QString qtInstallData = ProjectExplorer::DebuggingHelperLibrary::qtInstallDataDir(qmakePath); - QString dhl = ProjectExplorer::DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(qtInstallData); + Utils::FileName qmakePath = QtSupport::DebuggingHelperLibrary::findSystemQt(environment()); + QString qtInstallData = QtSupport::DebuggingHelperLibrary::qtInstallDataDir(qmakePath); + QString dhl = QtSupport::DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(qtInstallData); return dhl; } QStringList CMakeRunConfiguration::dumperLibraryLocations() const { - Utils::FileName qmakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(environment()); - QString qtInstallData = ProjectExplorer::DebuggingHelperLibrary::qtInstallDataDir(qmakePath); - return ProjectExplorer::DebuggingHelperLibrary::debuggingHelperLibraryDirectories(qtInstallData); + Utils::FileName qmakePath = QtSupport::DebuggingHelperLibrary::findSystemQt(environment()); + QString qtInstallData = QtSupport::DebuggingHelperLibrary::qtInstallDataDir(qmakePath); + return QtSupport::DebuggingHelperLibrary::debuggingHelperLibraryDirectories(qtInstallData); } Utils::Environment CMakeRunConfiguration::baseEnvironment() const diff --git a/src/plugins/cmakeprojectmanager/cmaketarget.cpp b/src/plugins/cmakeprojectmanager/cmaketarget.cpp index 4672659582..97aee20fb4 100644 --- a/src/plugins/cmakeprojectmanager/cmaketarget.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketarget.cpp @@ -38,8 +38,8 @@ #include #include -#include #include +#include #include #include @@ -117,8 +117,8 @@ void CMakeTarget::updateRunConfigurations() foreach (ProjectExplorer::RunConfiguration* rc, runConfigurations()) { if (CMakeRunConfiguration* cmakeRC = qobject_cast(rc)) existingRunConfigurations.insert(cmakeRC->title(), cmakeRC); - ProjectExplorer::CustomExecutableRunConfiguration *ceRC = - qobject_cast(rc); + QtSupport::CustomExecutableRunConfiguration *ceRC = + qobject_cast(rc); if (ceRC && !ceRC->isConfigured()) toRemove << rc; } @@ -160,8 +160,7 @@ void CMakeTarget::updateRunConfigurations() if (runConfigurations().isEmpty()) { // Oh no, no run configuration, // create a custom executable run configuration - ProjectExplorer::CustomExecutableRunConfiguration *rc = new ProjectExplorer::CustomExecutableRunConfiguration(this); - addRunConfiguration(rc); + addRunConfiguration(new QtSupport::CustomExecutableRunConfiguration(this)); } } diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index d67166bd57..64fb0f9a80 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -51,7 +51,6 @@ #endif #include -#include #include #include #include diff --git a/src/plugins/genericprojectmanager/GenericProjectManager.pluginspec.in b/src/plugins/genericprojectmanager/GenericProjectManager.pluginspec.in index 5bedf80058..58dcc649d0 100644 --- a/src/plugins/genericprojectmanager/GenericProjectManager.pluginspec.in +++ b/src/plugins/genericprojectmanager/GenericProjectManager.pluginspec.in @@ -17,5 +17,6 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General + diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index 045d7c384c..b037dfa0c8 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -39,9 +39,9 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -477,7 +477,7 @@ bool GenericProject::fromMap(const QVariantMap &map) continue; } if (!t->activeRunConfiguration()) - t->addRunConfiguration(new CustomExecutableRunConfiguration(t)); + t->addRunConfiguration(new QtSupport::CustomExecutableRunConfiguration(t)); } // Add default setup: diff --git a/src/plugins/genericprojectmanager/genericprojectmanager.qbs b/src/plugins/genericprojectmanager/genericprojectmanager.qbs index 853c7e0845..a498e45f41 100644 --- a/src/plugins/genericprojectmanager/genericprojectmanager.qbs +++ b/src/plugins/genericprojectmanager/genericprojectmanager.qbs @@ -13,6 +13,7 @@ QtcPlugin { Depends { name: "ProjectExplorer" } Depends { name: "Find" } Depends { name: "Locator" } + Depends { name: "QtSupport" } Depends { name: "cpp" } cpp.includePaths: [ diff --git a/src/plugins/genericprojectmanager/genericprojectmanager_dependencies.pri b/src/plugins/genericprojectmanager/genericprojectmanager_dependencies.pri index 78430f853b..03f29efcdb 100644 --- a/src/plugins/genericprojectmanager/genericprojectmanager_dependencies.pri +++ b/src/plugins/genericprojectmanager/genericprojectmanager_dependencies.pri @@ -1,3 +1,4 @@ include(../../plugins/projectexplorer/projectexplorer.pri) include(../../plugins/cpptools/cpptools.pri) include(../../plugins/texteditor/texteditor.pri) +include(../../plugins/qtsupport/qtsupport.pri) diff --git a/src/plugins/genericprojectmanager/generictarget.cpp b/src/plugins/genericprojectmanager/generictarget.cpp index 314d423d84..d876dcdac8 100644 --- a/src/plugins/genericprojectmanager/generictarget.cpp +++ b/src/plugins/genericprojectmanager/generictarget.cpp @@ -37,9 +37,9 @@ #include "genericmakestep.h" #include -#include #include #include +#include #include #include @@ -153,7 +153,7 @@ GenericTarget *GenericTargetFactory::create(ProjectExplorer::Project *parent, co // Add a runconfiguration. The CustomExecutableRC one will query the user // for its settings, so it is a good choice here. - t->addRunConfiguration(new ProjectExplorer::CustomExecutableRunConfiguration(t)); + t->addRunConfiguration(new QtSupport::CustomExecutableRunConfiguration(t)); return t; } diff --git a/src/plugins/madde/qt4maemotarget.cpp b/src/plugins/madde/qt4maemotarget.cpp index 61e59c2d4f..6c5326a790 100644 --- a/src/plugins/madde/qt4maemotarget.cpp +++ b/src/plugins/madde/qt4maemotarget.cpp @@ -44,7 +44,6 @@ #include #include #include -#include #include #include #include @@ -52,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -180,7 +180,7 @@ void AbstractQt4MaemoTarget::createApplicationProFiles(bool reparse) // Oh still none? Add a custom executable runconfiguration if (runConfigurations().isEmpty()) { - addRunConfiguration(new ProjectExplorer::CustomExecutableRunConfiguration(this)); + addRunConfiguration(new QtSupport::CustomExecutableRunConfiguration(this)); } } diff --git a/src/plugins/madde/qt4maemotargetfactory.cpp b/src/plugins/madde/qt4maemotargetfactory.cpp index 23ad45fb98..9ca58d8e10 100644 --- a/src/plugins/madde/qt4maemotargetfactory.cpp +++ b/src/plugins/madde/qt4maemotargetfactory.cpp @@ -38,10 +38,10 @@ #include #include -#include #include #include #include +#include #include #include @@ -217,7 +217,7 @@ ProjectExplorer::Target *Qt4MaemoTargetFactory::create(ProjectExplorer::Project } target->createApplicationProFiles(false); if (target->runConfigurations().isEmpty()) - target->addRunConfiguration(new ProjectExplorer::CustomExecutableRunConfiguration(target)); + target->addRunConfiguration(new QtSupport::CustomExecutableRunConfiguration(target)); return target; } diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 87cc7ef1d8..509a315bc7 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -225,16 +225,19 @@ plugin_cmakeprojectmanager.subdir = cmakeprojectmanager plugin_cmakeprojectmanager.depends = plugin_texteditor plugin_cmakeprojectmanager.depends += plugin_projectexplorer plugin_cmakeprojectmanager.depends += plugin_cpptools +plugin_cmakeprojectmanager.depends += plugin_qtsupport plugin_autotoolsprojectmanager.subdir = autotoolsprojectmanager plugin_autotoolsprojectmanager.depends = plugin_projectexplorer plugin_autotoolsprojectmanager.depends += plugin_coreplugin plugin_autotoolsprojectmanager.depends += plugin_cpptools +plugin_autotoolsprojectmanager.depends += plugin_qtsupport plugin_genericprojectmanager.subdir = genericprojectmanager plugin_genericprojectmanager.depends = plugin_texteditor plugin_genericprojectmanager.depends += plugin_projectexplorer plugin_genericprojectmanager.depends += plugin_cpptools +plugin_genericprojectmanager.depends += plugin_qtsupport plugin_qmljseditor.subdir = qmljseditor plugin_qmljseditor.depends = plugin_texteditor diff --git a/src/plugins/projectexplorer/customexecutableconfigurationwidget.cpp b/src/plugins/projectexplorer/customexecutableconfigurationwidget.cpp deleted file mode 100644 index 6a6454dcd1..0000000000 --- a/src/plugins/projectexplorer/customexecutableconfigurationwidget.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** -** GNU Lesser General Public License Usage -** -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -**************************************************************************/ - -#include "customexecutableconfigurationwidget.h" -#include "customexecutablerunconfiguration.h" -#include "target.h" -#include "project.h" -#include "environmentwidget.h" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - - -namespace ProjectExplorer { -namespace Internal { - -CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc) - : m_ignoreChange(false), m_runConfiguration(rc) -{ - QFormLayout *layout = new QFormLayout; - layout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); - layout->setMargin(0); - - m_executableChooser = new Utils::PathChooser(this); - m_executableChooser->setExpectedKind(Utils::PathChooser::Command); - m_executableChooser->setEnvironment(rc->environment()); - layout->addRow(tr("Executable:"), m_executableChooser); - - m_commandLineArgumentsLineEdit = new QLineEdit(this); - m_commandLineArgumentsLineEdit->setMinimumWidth(200); // this shouldn't be fixed here... - layout->addRow(tr("Arguments:"), m_commandLineArgumentsLineEdit); - - m_workingDirectory = new Utils::PathChooser(this); - m_workingDirectory->setExpectedKind(Utils::PathChooser::Directory); - m_workingDirectory->setBaseDirectory(rc->target()->project()->projectDirectory()); - m_workingDirectory->setEnvironment(rc->environment()); - layout->addRow(tr("Working directory:"), m_workingDirectory); - - m_useTerminalCheck = new QCheckBox(tr("Run in &terminal"), this); - layout->addRow(QString(), m_useTerminalCheck); - - QVBoxLayout *vbox = new QVBoxLayout(this); - vbox->setMargin(0); - - m_detailsContainer = new Utils::DetailsWidget(this); - m_detailsContainer->setState(Utils::DetailsWidget::NoSummary); - vbox->addWidget(m_detailsContainer); - - QWidget *detailsWidget = new QWidget(m_detailsContainer); - m_detailsContainer->setWidget(detailsWidget); - detailsWidget->setLayout(layout); - - QLabel *environmentLabel = new QLabel(this); - environmentLabel->setText(tr("Run Environment")); - QFont f = environmentLabel->font(); - f.setBold(true); - f.setPointSizeF(f.pointSizeF() *1.2); - environmentLabel->setFont(f); - vbox->addWidget(environmentLabel); - - QWidget *baseEnvironmentWidget = new QWidget; - QHBoxLayout *baseEnvironmentLayout = new QHBoxLayout(baseEnvironmentWidget); - baseEnvironmentLayout->setMargin(0); - QLabel *label = new QLabel(tr("Base environment for this run configuration:"), this); - baseEnvironmentLayout->addWidget(label); - m_baseEnvironmentComboBox = new QComboBox(this); - m_baseEnvironmentComboBox->addItems(QStringList() - << tr("Clean Environment") - << tr("System Environment") - << tr("Build Environment")); - m_baseEnvironmentComboBox->setCurrentIndex(rc->baseEnvironmentBase()); - connect(m_baseEnvironmentComboBox, SIGNAL(currentIndexChanged(int)), - this, SLOT(baseEnvironmentSelected(int))); - baseEnvironmentLayout->addWidget(m_baseEnvironmentComboBox); - baseEnvironmentLayout->addStretch(10); - - m_environmentWidget = new EnvironmentWidget(this, baseEnvironmentWidget); - m_environmentWidget->setBaseEnvironment(rc->baseEnvironment()); - m_environmentWidget->setBaseEnvironmentText(rc->baseEnvironmentText()); - m_environmentWidget->setUserChanges(rc->userEnvironmentChanges()); - vbox->addWidget(m_environmentWidget); - - changed(); - - connect(m_executableChooser, SIGNAL(changed(QString)), - this, SLOT(executableEdited())); - connect(m_commandLineArgumentsLineEdit, SIGNAL(textEdited(QString)), - this, SLOT(argumentsEdited(QString))); - connect(m_workingDirectory, SIGNAL(changed(QString)), - this, SLOT(workingDirectoryEdited())); - connect(m_useTerminalCheck, SIGNAL(toggled(bool)), - this, SLOT(termToggled(bool))); - - connect(m_runConfiguration, SIGNAL(changed()), this, SLOT(changed())); - - connect(m_environmentWidget, SIGNAL(userChangesChanged()), - this, SLOT(userChangesChanged())); - - connect(m_runConfiguration, SIGNAL(baseEnvironmentChanged()), - this, SLOT(baseEnvironmentChanged())); - connect(m_runConfiguration, SIGNAL(userEnvironmentChangesChanged(QList)), - this, SLOT(userEnvironmentChangesChanged())); -} - -void CustomExecutableConfigurationWidget::userChangesChanged() -{ - m_runConfiguration->setUserEnvironmentChanges(m_environmentWidget->userChanges()); -} - -void CustomExecutableConfigurationWidget::baseEnvironmentSelected(int index) -{ - m_ignoreChange = true; - m_runConfiguration->setBaseEnvironmentBase(CustomExecutableRunConfiguration::BaseEnvironmentBase(index)); - - m_environmentWidget->setBaseEnvironment(m_runConfiguration->baseEnvironment()); - m_environmentWidget->setBaseEnvironmentText(m_runConfiguration->baseEnvironmentText()); - m_ignoreChange = false; -} - -void CustomExecutableConfigurationWidget::baseEnvironmentChanged() -{ - if (m_ignoreChange) - return; - - int index = CustomExecutableRunConfiguration::BaseEnvironmentBase( - m_runConfiguration->baseEnvironmentBase()); - m_baseEnvironmentComboBox->setCurrentIndex(index); - m_environmentWidget->setBaseEnvironment(m_runConfiguration->baseEnvironment()); - m_environmentWidget->setBaseEnvironmentText(m_runConfiguration->baseEnvironmentText()); -} - -void CustomExecutableConfigurationWidget::userEnvironmentChangesChanged() -{ - m_environmentWidget->setUserChanges(m_runConfiguration->userEnvironmentChanges()); -} - - -void CustomExecutableConfigurationWidget::executableEdited() -{ - m_ignoreChange = true; - m_runConfiguration->setExecutable(m_executableChooser->rawPath()); - m_ignoreChange = false; -} -void CustomExecutableConfigurationWidget::argumentsEdited(const QString &arguments) -{ - m_ignoreChange = true; - m_runConfiguration->setCommandLineArguments(arguments); - m_ignoreChange = false; -} -void CustomExecutableConfigurationWidget::workingDirectoryEdited() -{ - m_ignoreChange = true; - m_runConfiguration->setBaseWorkingDirectory(m_workingDirectory->rawPath()); - m_ignoreChange = false; -} - -void CustomExecutableConfigurationWidget::termToggled(bool on) -{ - m_ignoreChange = true; - m_runConfiguration->setRunMode(on ? LocalApplicationRunConfiguration::Console - : LocalApplicationRunConfiguration::Gui); - m_ignoreChange = false; -} - -void CustomExecutableConfigurationWidget::changed() -{ - // We triggered the change, don't update us - if (m_ignoreChange) - return; - - m_executableChooser->setPath(m_runConfiguration->rawExecutable()); - m_commandLineArgumentsLineEdit->setText(m_runConfiguration->rawCommandLineArguments()); - m_workingDirectory->setPath(m_runConfiguration->baseWorkingDirectory()); - m_useTerminalCheck->setChecked(m_runConfiguration->runMode() == LocalApplicationRunConfiguration::Console); -} - -} // namespace Internal -} // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/customexecutableconfigurationwidget.h b/src/plugins/projectexplorer/customexecutableconfigurationwidget.h deleted file mode 100644 index 4cf2ffe7a8..0000000000 --- a/src/plugins/projectexplorer/customexecutableconfigurationwidget.h +++ /dev/null @@ -1,93 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** -** GNU Lesser General Public License Usage -** -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -**************************************************************************/ - -#ifndef CUSTOMEXECUTABLECONFIGURATIONWIDGET_H -#define CUSTOMEXECUTABLECONFIGURATIONWIDGET_H - -#include - -QT_BEGIN_NAMESPACE -class QCheckBox; -class QLineEdit; -class QComboBox; -class QLabel; -class QAbstractButton; -QT_END_NAMESPACE - -namespace Utils { -class DetailsWidget; -class PathChooser; -} - -namespace ProjectExplorer { -class CustomExecutableRunConfiguration; -class EnvironmentWidget; - -namespace Internal { - -class CustomExecutableConfigurationWidget : public QWidget -{ - Q_OBJECT - -public: - CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc); - -private slots: - void changed(); - - void executableEdited(); - void argumentsEdited(const QString &arguments); - void workingDirectoryEdited(); - void termToggled(bool); - - void userChangesChanged(); - void baseEnvironmentChanged(); - void userEnvironmentChangesChanged(); - void baseEnvironmentSelected(int index); - -private: - bool m_ignoreChange; - CustomExecutableRunConfiguration *m_runConfiguration; - Utils::PathChooser *m_executableChooser; - QLineEdit *m_userName; - QLineEdit *m_commandLineArgumentsLineEdit; - Utils::PathChooser *m_workingDirectory; - QCheckBox *m_useTerminalCheck; - ProjectExplorer::EnvironmentWidget *m_environmentWidget; - QComboBox *m_baseEnvironmentComboBox; - Utils::DetailsWidget *m_detailsContainer; -}; - -} // namespace Internal -} // namespace ProjectExplorer - -#endif // CUSTOMEXECUTABLECONFIGURATIONWIDGET_H diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp deleted file mode 100644 index bfe609232d..0000000000 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp +++ /dev/null @@ -1,417 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** -** GNU Lesser General Public License Usage -** -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -**************************************************************************/ - -#include "customexecutablerunconfiguration.h" -#include "customexecutableconfigurationwidget.h" - -#include "buildconfiguration.h" -#include "debugginghelper.h" -#include "projectexplorerconstants.h" -#include "target.h" -#include "abi.h" - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include - -using namespace ProjectExplorer; -using namespace ProjectExplorer::Internal; - -namespace { -const char * const CUSTOM_EXECUTABLE_ID("ProjectExplorer.CustomExecutableRunConfiguration"); - -const char * const EXECUTABLE_KEY("ProjectExplorer.CustomExecutableRunConfiguration.Executable"); -const char * const ARGUMENTS_KEY("ProjectExplorer.CustomExecutableRunConfiguration.Arguments"); -const char * const WORKING_DIRECTORY_KEY("ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory"); -const char * const USE_TERMINAL_KEY("ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal"); -const char * const USER_ENVIRONMENT_CHANGES_KEY("ProjectExplorer.CustomExecutableRunConfiguration.UserEnvironmentChanges"); -const char * const BASE_ENVIRONMENT_BASE_KEY("ProjectExplorer.CustomExecutableRunConfiguration.BaseEnvironmentBase"); -} - -void CustomExecutableRunConfiguration::ctor() -{ - setDefaultDisplayName(defaultDisplayName()); - - connect(target(), SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)), - this, SLOT(activeBuildConfigurationChanged())); - - m_lastActiveBuildConfiguration = activeBuildConfiguration(); - - if (m_lastActiveBuildConfiguration) { - connect(m_lastActiveBuildConfiguration, SIGNAL(environmentChanged()), - this, SIGNAL(baseEnvironmentChanged())); - } -} - -CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *parent) : - LocalApplicationRunConfiguration(parent, Core::Id(CUSTOM_EXECUTABLE_ID)), - m_workingDirectory(QLatin1String(ProjectExplorer::Constants::DEFAULT_WORKING_DIR)), - m_runMode(Gui), - m_baseEnvironmentBase(CustomExecutableRunConfiguration::BuildEnvironmentBase) -{ - ctor(); -} - -CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *parent, CustomExecutableRunConfiguration *source) : - LocalApplicationRunConfiguration(parent, source), - m_executable(source->m_executable), - m_workingDirectory(source->m_workingDirectory), - m_cmdArguments(source->m_cmdArguments), - m_runMode(source->m_runMode), - m_userEnvironmentChanges(source->m_userEnvironmentChanges), - m_baseEnvironmentBase(source->m_baseEnvironmentBase) -{ - ctor(); -} - -// Note: Qt4Project deletes all empty customexecrunconfigs for which isConfigured() == false. -CustomExecutableRunConfiguration::~CustomExecutableRunConfiguration() -{ -} - -void CustomExecutableRunConfiguration::activeBuildConfigurationChanged() -{ - if (m_lastActiveBuildConfiguration) { - disconnect(m_lastActiveBuildConfiguration, SIGNAL(environmentChanged()), - this, SIGNAL(baseEnvironmentChanged())); - } - m_lastActiveBuildConfiguration = activeBuildConfiguration(); - if (m_lastActiveBuildConfiguration) { - connect(m_lastActiveBuildConfiguration, SIGNAL(environmentChanged()), - this, SIGNAL(baseEnvironmentChanged())); - } -} - -QString CustomExecutableRunConfiguration::executable() const -{ - Utils::Environment env = environment(); - QString exec = env.searchInPath(Utils::expandMacros(m_executable, macroExpander()), - QStringList() << workingDirectory()); - - if (exec.isEmpty() || !QFileInfo(exec).exists()) { - // Oh the executable doesn't exists, ask the user. - CustomExecutableRunConfiguration *that = const_cast(this); - QWidget *confWidget = that->createConfigurationWidget(); - confWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - QDialog dialog(Core::ICore::mainWindow()); - dialog.setWindowTitle(displayName()); - dialog.setWindowFlags(dialog.windowFlags() & ~Qt::WindowContextHelpButtonHint); - dialog.setLayout(new QVBoxLayout()); - QLabel *label = new QLabel(tr("Could not find the executable, please specify one.")); - label->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - dialog.layout()->addWidget(label); - dialog.layout()->addWidget(confWidget); - QDialogButtonBox *dbb = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); - connect(dbb, SIGNAL(accepted()), &dialog, SLOT(accept())); - connect(dbb, SIGNAL(rejected()), &dialog, SLOT(reject())); - dialog.layout()->addWidget(dbb); - dialog.layout()->setSizeConstraint(QLayout::SetMinAndMaxSize); - - QString oldExecutable = m_executable; - QString oldWorkingDirectory = m_workingDirectory; - QString oldCmdArguments = m_cmdArguments; - - if (dialog.exec() == QDialog::Accepted) { - return executable(); - } else { - // Restore values changed by the configuration widget. - if (that->m_executable != oldExecutable - || that->m_workingDirectory != oldWorkingDirectory - || that->m_cmdArguments != oldCmdArguments) { - that->m_executable = oldExecutable; - that->m_workingDirectory = oldWorkingDirectory; - that->m_cmdArguments = oldCmdArguments; - emit that->changed(); - } - return QString(); - } - } - return QDir::cleanPath(exec); -} - -QString CustomExecutableRunConfiguration::rawExecutable() const -{ - return m_executable; -} - -bool CustomExecutableRunConfiguration::isConfigured() const -{ - return !m_executable.isEmpty(); -} - -LocalApplicationRunConfiguration::RunMode CustomExecutableRunConfiguration::runMode() const -{ - return m_runMode; -} - -QString CustomExecutableRunConfiguration::workingDirectory() const -{ - return QDir::cleanPath(environment().expandVariables( - Utils::expandMacros(baseWorkingDirectory(), macroExpander()))); -} - -QString CustomExecutableRunConfiguration::baseWorkingDirectory() const -{ - return m_workingDirectory; -} - - -QString CustomExecutableRunConfiguration::commandLineArguments() const -{ - return Utils::QtcProcess::expandMacros(m_cmdArguments, macroExpander()); -} - -QString CustomExecutableRunConfiguration::rawCommandLineArguments() const -{ - return m_cmdArguments; -} - -QString CustomExecutableRunConfiguration::baseEnvironmentText() const -{ - if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::CleanEnvironmentBase) { - return tr("Clean Environment"); - } else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::SystemEnvironmentBase) { - return tr("System Environment"); - } else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::BuildEnvironmentBase) { - return tr("Build Environment"); - } - return QString(); -} - -Utils::Environment CustomExecutableRunConfiguration::baseEnvironment() const -{ - Utils::Environment env; - if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::CleanEnvironmentBase) { - // Nothing - } else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::SystemEnvironmentBase) { - env = Utils::Environment::systemEnvironment(); - } else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::BuildEnvironmentBase) { - if (activeBuildConfiguration()) - env = activeBuildConfiguration()->environment(); - } - return env; -} - -void CustomExecutableRunConfiguration::setBaseEnvironmentBase(BaseEnvironmentBase env) -{ - if (m_baseEnvironmentBase == env) - return; - m_baseEnvironmentBase = env; - emit baseEnvironmentChanged(); -} - -CustomExecutableRunConfiguration::BaseEnvironmentBase CustomExecutableRunConfiguration::baseEnvironmentBase() const -{ - return m_baseEnvironmentBase; -} - -Utils::Environment CustomExecutableRunConfiguration::environment() const -{ - Utils::Environment env = baseEnvironment(); - env.modify(userEnvironmentChanges()); - return env; -} - -QList CustomExecutableRunConfiguration::userEnvironmentChanges() const -{ - return m_userEnvironmentChanges; -} - -void CustomExecutableRunConfiguration::setUserEnvironmentChanges(const QList &diff) -{ - if (m_userEnvironmentChanges != diff) { - m_userEnvironmentChanges = diff; - emit userEnvironmentChangesChanged(diff); - } -} - -QString CustomExecutableRunConfiguration::defaultDisplayName() const -{ - if (m_executable.isEmpty()) - return tr("Custom Executable"); - else - return tr("Run %1").arg(QDir::toNativeSeparators(m_executable)); -} - -QVariantMap CustomExecutableRunConfiguration::toMap() const -{ - QVariantMap map(LocalApplicationRunConfiguration::toMap()); - map.insert(QLatin1String(EXECUTABLE_KEY), m_executable); - map.insert(QLatin1String(ARGUMENTS_KEY), m_cmdArguments); - map.insert(QLatin1String(WORKING_DIRECTORY_KEY), m_workingDirectory); - map.insert(QLatin1String(USE_TERMINAL_KEY), m_runMode == Console); - map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), Utils::EnvironmentItem::toStringList(m_userEnvironmentChanges)); - map.insert(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast(m_baseEnvironmentBase)); - return map; -} - -bool CustomExecutableRunConfiguration::fromMap(const QVariantMap &map) -{ - m_executable = map.value(QLatin1String(EXECUTABLE_KEY)).toString(); - m_cmdArguments = map.value(QLatin1String(ARGUMENTS_KEY)).toString(); - m_workingDirectory = map.value(QLatin1String(WORKING_DIRECTORY_KEY)).toString(); - m_runMode = map.value(QLatin1String(USE_TERMINAL_KEY)).toBool() ? Console : Gui; - m_userEnvironmentChanges = Utils::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList()); - m_baseEnvironmentBase = static_cast(map.value(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast(CustomExecutableRunConfiguration::BuildEnvironmentBase)).toInt()); - - setDefaultDisplayName(defaultDisplayName()); - return LocalApplicationRunConfiguration::fromMap(map); -} - -void CustomExecutableRunConfiguration::setExecutable(const QString &executable) -{ - if (executable == m_executable) - return; - m_executable = executable; - setDefaultDisplayName(defaultDisplayName()); - emit changed(); -} - -void CustomExecutableRunConfiguration::setCommandLineArguments(const QString &commandLineArguments) -{ - m_cmdArguments = commandLineArguments; - emit changed(); -} - -void CustomExecutableRunConfiguration::setBaseWorkingDirectory(const QString &workingDirectory) -{ - m_workingDirectory = workingDirectory; - emit changed(); -} - -void CustomExecutableRunConfiguration::setRunMode(RunMode runMode) -{ - m_runMode = runMode; - emit changed(); -} - -QWidget *CustomExecutableRunConfiguration::createConfigurationWidget() -{ - return new CustomExecutableConfigurationWidget(this); -} - -QString CustomExecutableRunConfiguration::dumperLibrary() const -{ - Utils::FileName qmakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(environment()); - QString qtInstallData = ProjectExplorer::DebuggingHelperLibrary::qtInstallDataDir(qmakePath); - return ProjectExplorer::DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(qtInstallData); -} - -QStringList CustomExecutableRunConfiguration::dumperLibraryLocations() const -{ - Utils::FileName qmakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(environment()); - QString qtInstallData = ProjectExplorer::DebuggingHelperLibrary::qtInstallDataDir(qmakePath); - return ProjectExplorer::DebuggingHelperLibrary::debuggingHelperLibraryDirectories(qtInstallData); -} - -ProjectExplorer::Abi CustomExecutableRunConfiguration::abi() const -{ - return Abi(); // return an invalid ABI: We do not know what we will end up running! -} - -// Factory - -CustomExecutableRunConfigurationFactory::CustomExecutableRunConfigurationFactory(QObject *parent) : - ProjectExplorer::IRunConfigurationFactory(parent) -{ -} - -CustomExecutableRunConfigurationFactory::~CustomExecutableRunConfigurationFactory() -{ - -} - -bool CustomExecutableRunConfigurationFactory::canCreate(Target *parent, const Core::Id id) const -{ - Q_UNUSED(parent); - return id == Core::Id(CUSTOM_EXECUTABLE_ID); -} - -RunConfiguration *CustomExecutableRunConfigurationFactory::create(Target *parent, const Core::Id id) -{ - if (!canCreate(parent, id)) - return 0; - - RunConfiguration *rc(new CustomExecutableRunConfiguration(parent)); - return rc; -} - -bool CustomExecutableRunConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const -{ - Core::Id id(idFromMap(map)); - return canCreate(parent, id); -} - -RunConfiguration *CustomExecutableRunConfigurationFactory::restore(Target *parent, const QVariantMap &map) -{ - if (!canRestore(parent, map)) - return 0; - CustomExecutableRunConfiguration *rc(new CustomExecutableRunConfiguration(parent)); - if (rc->fromMap(map)) - return rc; - delete rc; - return 0; -} - -bool CustomExecutableRunConfigurationFactory::canClone(Target *parent, RunConfiguration *source) const -{ - return canCreate(parent, source->id()); -} - -RunConfiguration *CustomExecutableRunConfigurationFactory::clone(Target *parent, RunConfiguration *source) -{ - if (!canClone(parent, source)) - return 0; - return new CustomExecutableRunConfiguration(parent, static_cast(source)); -} - -QList CustomExecutableRunConfigurationFactory::availableCreationIds(Target *parent) const -{ - Q_UNUSED(parent) - return QList() << Core::Id(CUSTOM_EXECUTABLE_ID); -} - -QString CustomExecutableRunConfigurationFactory::displayNameForId(const Core::Id id) const -{ - if (id == Core::Id(CUSTOM_EXECUTABLE_ID)) - return tr("Custom Executable"); - return QString(); -} diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.h b/src/plugins/projectexplorer/customexecutablerunconfiguration.h deleted file mode 100644 index a2c557d37d..0000000000 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.h +++ /dev/null @@ -1,153 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** -** GNU Lesser General Public License Usage -** -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -**************************************************************************/ - -#ifndef CUSTOMEXECUTABLERUNCONFIGURATION_H -#define CUSTOMEXECUTABLERUNCONFIGURATION_H - -#include "applicationrunconfiguration.h" - -#include - -#include - -namespace ProjectExplorer { -class Target; - -namespace Internal { -class CustomExecutableConfigurationWidget; -} - -class CustomExecutableRunConfigurationFactory; - -class PROJECTEXPLORER_EXPORT CustomExecutableRunConfiguration : public LocalApplicationRunConfiguration -{ - Q_OBJECT - // the configuration widget needs to setExecutable setWorkingDirectory and setCommandLineArguments - friend class Internal::CustomExecutableConfigurationWidget; - friend class CustomExecutableRunConfigurationFactory; - -public: - explicit CustomExecutableRunConfiguration(Target *parent); - ~CustomExecutableRunConfiguration(); - - /** - * Returns the executable, looks in the environment for it and might even - * ask the user if none is specified - */ - QString executable() const; - - /** Returns whether this runconfiguration ever was configured with a executable - */ - bool isConfigured() const; - - LocalApplicationRunConfiguration::RunMode runMode() const; - QString workingDirectory() const; - QString commandLineArguments() const; - Utils::Environment environment() const; - - QWidget *createConfigurationWidget(); - QString dumperLibrary() const; - QStringList dumperLibraryLocations() const; - - ProjectExplorer::Abi abi() const; - - QVariantMap toMap() const; - -signals: - void changed(); - - void baseEnvironmentChanged(); - void userEnvironmentChangesChanged(const QList &diff); - -private slots: - void activeBuildConfigurationChanged(); - -protected: - CustomExecutableRunConfiguration(Target *parent, CustomExecutableRunConfiguration *source); - virtual bool fromMap(const QVariantMap &map); - QString defaultDisplayName() const; - -private: - void ctor(); - - enum BaseEnvironmentBase { CleanEnvironmentBase = 0, - SystemEnvironmentBase = 1, - BuildEnvironmentBase = 2}; - void setBaseEnvironmentBase(BaseEnvironmentBase env); - BaseEnvironmentBase baseEnvironmentBase() const; - Utils::Environment baseEnvironment() const; - QString baseEnvironmentText() const; - void setUserEnvironmentChanges(const QList &diff); - QList userEnvironmentChanges() const; - - void setExecutable(const QString &executable); - QString rawExecutable() const; - void setCommandLineArguments(const QString &commandLineArguments); - QString rawCommandLineArguments() const; - void setBaseWorkingDirectory(const QString &workingDirectory); - QString baseWorkingDirectory() const; - void setUserName(const QString &name); - void setRunMode(RunMode runMode); - - QString m_executable; - QString m_workingDirectory; - QString m_cmdArguments; - RunMode m_runMode; - bool m_userSetName; - QString m_userName; - QList m_userEnvironmentChanges; - BaseEnvironmentBase m_baseEnvironmentBase; - ProjectExplorer::BuildConfiguration *m_lastActiveBuildConfiguration; -}; - -class CustomExecutableRunConfigurationFactory : public IRunConfigurationFactory -{ - Q_OBJECT - -public: - explicit CustomExecutableRunConfigurationFactory(QObject *parent = 0); - ~CustomExecutableRunConfigurationFactory(); - - QList availableCreationIds(Target *parent) const; - QString displayNameForId(const Core::Id id) const; - - bool canCreate(Target *parent, const Core::Id id) const; - RunConfiguration *create(Target *parent, const Core::Id id); - bool canRestore(Target *parent, const QVariantMap &map) const; - RunConfiguration *restore(Target *parent, const QVariantMap &map); - bool canClone(Target *parent, RunConfiguration *product) const; - RunConfiguration *clone(Target *parent, RunConfiguration *source); -}; - -} // namespace ProjectExplorer - -#endif // CUSTOMEXECUTABLERUNCONFIGURATION_H diff --git a/src/plugins/projectexplorer/debugginghelper.cpp b/src/plugins/projectexplorer/debugginghelper.cpp deleted file mode 100644 index 776d2a8d09..0000000000 --- a/src/plugins/projectexplorer/debugginghelper.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** -** GNU Lesser General Public License Usage -** -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -**************************************************************************/ - -#include "debugginghelper.h" - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -using namespace ProjectExplorer; - -static inline QStringList validBinaryFilenames() -{ - return QStringList() - << QLatin1String("debug/dumper.dll") - << QLatin1String("libdumper.dylib") - << QLatin1String("libdumper.so"); -} - -QStringList DebuggingHelperLibrary::debuggingHelperLibraryDirectories(const QString &qtInstallData) -{ - const QChar slash = QLatin1Char('/'); - const uint hash = qHash(qtInstallData); - QStringList directories; - directories - << (qtInstallData + QLatin1String("/qtc-debugging-helper/")) - << QDir::cleanPath((QCoreApplication::applicationDirPath() + QLatin1String("/../qtc-debugging-helper/") + QString::number(hash))) + slash - << (QDesktopServices::storageLocation(QDesktopServices::DataLocation) + QLatin1String("/qtc-debugging-helper/") + QString::number(hash)) + slash; - return directories; -} - -static QString sourcePath() -{ - return Core::ICore::resourcePath() + QLatin1String("/dumper/"); -} - -static QStringList sourceFileNames() -{ - return QStringList() - << QLatin1String("dumper.cpp") << QLatin1String("dumper_p.h") - << QLatin1String("dumper.h") << QLatin1String("dumper.pro") - << QLatin1String("LICENSE.LGPL") << QLatin1String("LGPL_EXCEPTION.TXT"); -} - -QString DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(const QString &qtInstallData) -{ - if (!Core::ICore::instance()) - return QString(); - - const QStringList directories = DebuggingHelperLibrary::debuggingHelperLibraryDirectories(qtInstallData); - const QStringList binFilenames = validBinaryFilenames(); - - return byInstallDataHelper(sourcePath(), sourceFileNames(), directories, binFilenames, false); -} - -QString DebuggingHelperLibrary::copy(const QString &qtInstallData, - QString *errorMessage) -{ - // Locations to try: - // $QTDIR/qtc-debugging-helper - // $APPLICATION-DIR/qtc-debugging-helper/$hash - // $USERDIR/qtc-debugging-helper/$hash - const QStringList directories = DebuggingHelperLibrary::debuggingHelperLibraryDirectories(qtInstallData); - - // Try to find a writeable directory. - foreach(const QString &directory, directories) - if (copyFiles(sourcePath(), sourceFileNames(), directory, errorMessage)) { - errorMessage->clear(); - return directory; - } - *errorMessage = QCoreApplication::translate("ProjectExplorer::DebuggingHelperLibrary", - "The debugger helpers could not be built in any of the directories:\n- %1\n\nReason: %2") - .arg(directories.join(QLatin1String("\n- ")), *errorMessage); - return QString(); -} - -bool DebuggingHelperLibrary::build(BuildHelperArguments arguments, QString *log, QString *errorMessage) -{ - arguments.proFilename = QLatin1String("dumper.pro"); - arguments.helperName = QCoreApplication::translate("ProjectExplorer::DebuggingHelperLibrary", - "GDB helper"); - return buildHelper(arguments, log, errorMessage); -} diff --git a/src/plugins/projectexplorer/debugginghelper.h b/src/plugins/projectexplorer/debugginghelper.h deleted file mode 100644 index 328f03f40b..0000000000 --- a/src/plugins/projectexplorer/debugginghelper.h +++ /dev/null @@ -1,61 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** -** GNU Lesser General Public License Usage -** -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -**************************************************************************/ - -#ifndef DEBUGGINGHELPER_H -#define DEBUGGINGHELPER_H - -#include "projectexplorer_export.h" - -#include - -#include - -QT_FORWARD_DECLARE_CLASS(QStringList) - -namespace ProjectExplorer { - -class PROJECTEXPLORER_EXPORT DebuggingHelperLibrary : public Utils::BuildableHelperLibrary -{ -public: - static QString debuggingHelperLibraryByInstallData(const QString &qtInstallData); - static QStringList debuggingHelperLibraryDirectories(const QString &qtInstallData); - - // Build the helpers and return the output log/errormessage. - static bool build(BuildHelperArguments arguments, QString *log, QString *errorMessage); - - // Copy the source files to a target location and return the chosen target location. - static QString copy(const QString &qtInstallData, QString *errorMessage); - -}; -} // namespace ProjectExplorer - -#endif // DEBUGGINGHELPER_H diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index b67e2303cd..2315b21892 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -51,7 +51,6 @@ #include "buildsettingspropertiespage.h" #include "currentprojectfind.h" #include "currentprojectfilter.h" -#include "customexecutablerunconfiguration.h" #include "editorsettingspropertiespage.h" #include "codestylesettingspropertiespage.h" #include "dependenciespanel.h" @@ -421,7 +420,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er addAutoReleasedObject(currentProjectFind); addAutoReleasedObject(new LocalApplicationRunControlFactory); - addAutoReleasedObject(new CustomExecutableRunConfigurationFactory); addAutoReleasedObject(new ProjectFileWizardExtension); diff --git a/src/plugins/projectexplorer/projectexplorer.pro b/src/plugins/projectexplorer/projectexplorer.pro index 072cc56d34..1c586140db 100644 --- a/src/plugins/projectexplorer/projectexplorer.pro +++ b/src/plugins/projectexplorer/projectexplorer.pro @@ -64,7 +64,6 @@ HEADERS += projectexplorer.h \ runsettingspropertiespage.h \ projecttreewidget.h \ foldernavigationwidget.h \ - customexecutablerunconfiguration.h \ buildprogress.h \ projectnodes.h \ sessiondialog.h \ @@ -80,7 +79,6 @@ HEADERS += projectexplorer.h \ toolchainoptionspage.h \ cesdkhandler.h \ gccparser.h \ - debugginghelper.h \ projectexplorersettingspage.h \ projectwelcomepage.h \ baseprojectwizarddialog.h \ @@ -97,7 +95,6 @@ HEADERS += projectexplorer.h \ abstractprocessstep.h \ taskhub.h \ localapplicationruncontrol.h \ - customexecutableconfigurationwidget.h \ metatypedeclarations.h \ publishing/publishingwizardselectiondialog.h \ publishing/ipublishingwizardfactory.h \ @@ -164,7 +161,6 @@ SOURCES += projectexplorer.cpp \ runsettingspropertiespage.cpp \ projecttreewidget.cpp \ foldernavigationwidget.cpp \ - customexecutablerunconfiguration.cpp \ buildprogress.cpp \ projectnodes.cpp \ sessiondialog.cpp \ @@ -180,7 +176,6 @@ SOURCES += projectexplorer.cpp \ toolchainoptionspage.cpp \ cesdkhandler.cpp \ gccparser.cpp \ - debugginghelper.cpp \ projectexplorersettingspage.cpp \ projectwelcomepage.cpp \ corelistenercheckingforrunningbuild.cpp \ @@ -197,7 +192,6 @@ SOURCES += projectexplorer.cpp \ taskhub.cpp \ processparameters.cpp \ localapplicationruncontrol.cpp \ - customexecutableconfigurationwidget.cpp \ publishing/publishingwizardselectiondialog.cpp \ appoutputpane.cpp \ codestylesettingspropertiespage.cpp \ diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index ced2215b0f..3df35b7a88 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -69,12 +69,6 @@ QtcPlugin { "currentprojectfilter.cpp", "currentprojectfind.cpp", "currentprojectfind.h", - "customexecutableconfigurationwidget.cpp", - "customexecutableconfigurationwidget.h", - "customexecutablerunconfiguration.cpp", - "customexecutablerunconfiguration.h", - "debugginghelper.cpp", - "debugginghelper.h", "dependenciespanel.h", "deployconfiguration.cpp", "deployconfiguration.h", diff --git a/src/plugins/qt4projectmanager/qt-desktop/desktopqtversionfactory.cpp b/src/plugins/qt4projectmanager/qt-desktop/desktopqtversionfactory.cpp index e012c7f12b..2f4d547edf 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/desktopqtversionfactory.cpp +++ b/src/plugins/qt4projectmanager/qt-desktop/desktopqtversionfactory.cpp @@ -33,7 +33,6 @@ #include "qt4projectmanagerconstants.h" #include "desktopqtversion.h" -#include #include #include diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptarget.cpp b/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptarget.cpp index 55137a4243..d784efcea6 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptarget.cpp +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptarget.cpp @@ -36,7 +36,7 @@ #include "qt4runconfiguration.h" #include "qt4buildconfiguration.h" #include -#include +#include #include #include @@ -95,7 +95,7 @@ void Qt4DesktopTarget::createApplicationProFiles(bool reparse) // Oh still none? Add a custom executable runconfiguration if (runConfigurations().isEmpty()) { - addRunConfiguration(new ProjectExplorer::CustomExecutableRunConfiguration(this)); + addRunConfiguration(new QtSupport::CustomExecutableRunConfiguration(this)); } } diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp b/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp index a4e095e408..47ab921d69 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp @@ -39,8 +39,8 @@ #include #include -#include #include +#include #include @@ -192,6 +192,6 @@ ProjectExplorer::Target *Qt4DesktopTargetFactory::create(ProjectExplorer::Projec t->createApplicationProFiles(false); if (t->runConfigurations().isEmpty()) - t->addRunConfiguration(new ProjectExplorer::CustomExecutableRunConfiguration(t)); + t->addRunConfiguration(new QtSupport::CustomExecutableRunConfiguration(t)); return t; } diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.h b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.h index 3db37bba26..8152690879 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.h +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.h @@ -90,8 +90,8 @@ public: virtual QString workingDirectory() const; virtual QString commandLineArguments() const; virtual Utils::Environment environment() const; - virtual QString dumperLibrary() const; - virtual QStringList dumperLibraryLocations() const; + QString dumperLibrary() const; + QStringList dumperLibraryLocations() const; bool isUsingDyldImageSuffix() const; void setUsingDyldImageSuffix(bool state); diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4simulatortarget.cpp b/src/plugins/qt4projectmanager/qt-desktop/qt4simulatortarget.cpp index 0c695af87c..049f3d0501 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4simulatortarget.cpp +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4simulatortarget.cpp @@ -36,8 +36,8 @@ #include "qt4runconfiguration.h" #include "qt4buildconfiguration.h" -#include #include +#include #include using namespace Qt4ProjectManager; @@ -91,7 +91,7 @@ void Qt4SimulatorTarget::createApplicationProFiles(bool reparse) // Oh still none? Add a custom executable runconfiguration if (runConfigurations().isEmpty()) { - addRunConfiguration(new ProjectExplorer::CustomExecutableRunConfiguration(this)); + addRunConfiguration(new QtSupport::CustomExecutableRunConfiguration(this)); } } diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4simulatortargetfactory.cpp b/src/plugins/qt4projectmanager/qt-desktop/qt4simulatortargetfactory.cpp index 3daacc4e57..cf20eb813c 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4simulatortargetfactory.cpp +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4simulatortargetfactory.cpp @@ -40,7 +40,7 @@ #include #include -#include +#include #include #include @@ -168,6 +168,6 @@ ProjectExplorer::Target *Qt4SimulatorTargetFactory::create(ProjectExplorer::Proj t->createApplicationProFiles(false); if (t->runConfigurations().isEmpty()) - t->addRunConfiguration(new ProjectExplorer::CustomExecutableRunConfiguration(t)); + t->addRunConfiguration(new QtSupport::CustomExecutableRunConfiguration(t)); return t; } diff --git a/src/plugins/qt4projectmanager/qt-s60/qt4symbiantarget.cpp b/src/plugins/qt4projectmanager/qt-s60/qt4symbiantarget.cpp index dc548a20af..00d3fad54a 100644 --- a/src/plugins/qt4projectmanager/qt-s60/qt4symbiantarget.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/qt4symbiantarget.cpp @@ -40,11 +40,11 @@ #include "qt-s60/s60deployconfiguration.h" #include "qt-s60/s60devicerunconfiguration.h" -#include #include #include #include #include +#include #include #include @@ -104,7 +104,7 @@ void Qt4SymbianTarget::createApplicationProFiles(bool reparse) // Oh still none? Add a custom executable runconfiguration if (runConfigurations().isEmpty()) { - addRunConfiguration(new ProjectExplorer::CustomExecutableRunConfiguration(this)); + addRunConfiguration(new QtSupport::CustomExecutableRunConfiguration(this)); } } diff --git a/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp b/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp index 9415b13ca2..9f90794900 100644 --- a/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp @@ -42,8 +42,8 @@ #include "qt-s60/qt4symbiantarget.h" #include -#include #include +#include #include @@ -210,7 +210,7 @@ ProjectExplorer::Target *Qt4SymbianTargetFactory::create(ProjectExplorer::Projec t->createApplicationProFiles(false); if (t->runConfigurations().isEmpty()) - t->addRunConfiguration(new ProjectExplorer::CustomExecutableRunConfiguration(t)); + t->addRunConfiguration(new QtSupport::CustomExecutableRunConfiguration(t)); return t; } diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp index e8be9ce3a7..03ce7eec05 100644 --- a/src/plugins/qt4projectmanager/qt4project.cpp +++ b/src/plugins/qt4projectmanager/qt4project.cpp @@ -57,10 +57,10 @@ #include #include #include -#include #include #include #include +#include #include #include #include diff --git a/src/plugins/qt4projectmanager/qt4target.cpp b/src/plugins/qt4projectmanager/qt4target.cpp index adfe39b697..503fdabac8 100644 --- a/src/plugins/qt4projectmanager/qt4target.cpp +++ b/src/plugins/qt4projectmanager/qt4target.cpp @@ -47,11 +47,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include @@ -347,8 +347,8 @@ void Qt4BaseTarget::removeUnconfiguredCustomExectutableRunConfigurations() // Remove all run configurations which the new project wizard created QList toRemove; foreach (ProjectExplorer::RunConfiguration * rc, runConfigurations()) { - ProjectExplorer::CustomExecutableRunConfiguration *cerc - = qobject_cast(rc); + QtSupport::CustomExecutableRunConfiguration *cerc + = qobject_cast(rc); if (cerc && !cerc->isConfigured()) toRemove.append(rc); } diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index c496fe9bbc..bfff9efcf2 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -39,11 +39,11 @@ #include "profilereader.h" #include #include -#include #include #include #include #include +#include #include #include @@ -795,7 +795,7 @@ void BaseQtVersion::updateVersionInfo() const const QString qtInstallBins = m_versionInfo.value(installBinsKey); const QString qtHeaderData = m_versionInfo.value(installHeadersKey); if (!qtInstallData.isEmpty()) { - m_hasDebuggingHelper = !ProjectExplorer::DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(qtInstallData).isEmpty(); + m_hasDebuggingHelper = !QtSupport::DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(qtInstallData).isEmpty(); m_hasQmlDump = !QmlDumpTool::toolForQtPaths(qtInstallData, qtInstallBins, qtHeaderData, false).isEmpty() || !QmlDumpTool::toolForQtPaths(qtInstallData, qtInstallBins, qtHeaderData, true).isEmpty(); @@ -964,7 +964,7 @@ QString BaseQtVersion::gdbDebuggingHelperLibrary() const QString qtInstallData = versionInfo().value(QLatin1String("QT_INSTALL_DATA")); if (qtInstallData.isEmpty()) return QString(); - return ProjectExplorer::DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(qtInstallData); + return QtSupport::DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(qtInstallData); } QString BaseQtVersion::qmlDumpTool(bool debugVersion) const @@ -998,7 +998,7 @@ QStringList BaseQtVersion::debuggingHelperLibraryLocations() const QString qtInstallData = versionInfo().value(QLatin1String("QT_INSTALL_DATA")); if (qtInstallData.isEmpty()) return QStringList(); - return ProjectExplorer::DebuggingHelperLibrary::debuggingHelperLibraryDirectories(qtInstallData); + return QtSupport::DebuggingHelperLibrary::debuggingHelperLibraryDirectories(qtInstallData); } bool BaseQtVersion::supportsBinaryDebuggingHelper() const diff --git a/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp b/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp new file mode 100644 index 0000000000..c907a8d4ec --- /dev/null +++ b/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp @@ -0,0 +1,217 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** Other Usage +** +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +**************************************************************************/ + +#include "customexecutableconfigurationwidget.h" +#include "customexecutablerunconfiguration.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + + +namespace QtSupport { +namespace Internal { + +CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc) + : m_ignoreChange(false), m_runConfiguration(rc) +{ + QFormLayout *layout = new QFormLayout; + layout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); + layout->setMargin(0); + + m_executableChooser = new Utils::PathChooser(this); + m_executableChooser->setExpectedKind(Utils::PathChooser::Command); + m_executableChooser->setEnvironment(rc->environment()); + layout->addRow(tr("Executable:"), m_executableChooser); + + m_commandLineArgumentsLineEdit = new QLineEdit(this); + m_commandLineArgumentsLineEdit->setMinimumWidth(200); // this shouldn't be fixed here... + layout->addRow(tr("Arguments:"), m_commandLineArgumentsLineEdit); + + m_workingDirectory = new Utils::PathChooser(this); + m_workingDirectory->setExpectedKind(Utils::PathChooser::Directory); + m_workingDirectory->setBaseDirectory(rc->target()->project()->projectDirectory()); + m_workingDirectory->setEnvironment(rc->environment()); + layout->addRow(tr("Working directory:"), m_workingDirectory); + + m_useTerminalCheck = new QCheckBox(tr("Run in &terminal"), this); + layout->addRow(QString(), m_useTerminalCheck); + + QVBoxLayout *vbox = new QVBoxLayout(this); + vbox->setMargin(0); + + m_detailsContainer = new Utils::DetailsWidget(this); + m_detailsContainer->setState(Utils::DetailsWidget::NoSummary); + vbox->addWidget(m_detailsContainer); + + QWidget *detailsWidget = new QWidget(m_detailsContainer); + m_detailsContainer->setWidget(detailsWidget); + detailsWidget->setLayout(layout); + + QLabel *environmentLabel = new QLabel(this); + environmentLabel->setText(tr("Run Environment")); + QFont f = environmentLabel->font(); + f.setBold(true); + f.setPointSizeF(f.pointSizeF() *1.2); + environmentLabel->setFont(f); + vbox->addWidget(environmentLabel); + + QWidget *baseEnvironmentWidget = new QWidget; + QHBoxLayout *baseEnvironmentLayout = new QHBoxLayout(baseEnvironmentWidget); + baseEnvironmentLayout->setMargin(0); + QLabel *label = new QLabel(tr("Base environment for this run configuration:"), this); + baseEnvironmentLayout->addWidget(label); + m_baseEnvironmentComboBox = new QComboBox(this); + m_baseEnvironmentComboBox->addItems(QStringList() + << tr("Clean Environment") + << tr("System Environment") + << tr("Build Environment")); + m_baseEnvironmentComboBox->setCurrentIndex(rc->baseEnvironmentBase()); + connect(m_baseEnvironmentComboBox, SIGNAL(currentIndexChanged(int)), + this, SLOT(baseEnvironmentSelected(int))); + baseEnvironmentLayout->addWidget(m_baseEnvironmentComboBox); + baseEnvironmentLayout->addStretch(10); + + m_environmentWidget = new ProjectExplorer::EnvironmentWidget(this, baseEnvironmentWidget); + m_environmentWidget->setBaseEnvironment(rc->baseEnvironment()); + m_environmentWidget->setBaseEnvironmentText(rc->baseEnvironmentText()); + m_environmentWidget->setUserChanges(rc->userEnvironmentChanges()); + vbox->addWidget(m_environmentWidget); + + changed(); + + connect(m_executableChooser, SIGNAL(changed(QString)), + this, SLOT(executableEdited())); + connect(m_commandLineArgumentsLineEdit, SIGNAL(textEdited(QString)), + this, SLOT(argumentsEdited(QString))); + connect(m_workingDirectory, SIGNAL(changed(QString)), + this, SLOT(workingDirectoryEdited())); + connect(m_useTerminalCheck, SIGNAL(toggled(bool)), + this, SLOT(termToggled(bool))); + + connect(m_runConfiguration, SIGNAL(changed()), this, SLOT(changed())); + + connect(m_environmentWidget, SIGNAL(userChangesChanged()), + this, SLOT(userChangesChanged())); + + connect(m_runConfiguration, SIGNAL(baseEnvironmentChanged()), + this, SLOT(baseEnvironmentChanged())); + connect(m_runConfiguration, SIGNAL(userEnvironmentChangesChanged(QList)), + this, SLOT(userEnvironmentChangesChanged())); +} + +void CustomExecutableConfigurationWidget::userChangesChanged() +{ + m_runConfiguration->setUserEnvironmentChanges(m_environmentWidget->userChanges()); +} + +void CustomExecutableConfigurationWidget::baseEnvironmentSelected(int index) +{ + m_ignoreChange = true; + m_runConfiguration->setBaseEnvironmentBase(CustomExecutableRunConfiguration::BaseEnvironmentBase(index)); + + m_environmentWidget->setBaseEnvironment(m_runConfiguration->baseEnvironment()); + m_environmentWidget->setBaseEnvironmentText(m_runConfiguration->baseEnvironmentText()); + m_ignoreChange = false; +} + +void CustomExecutableConfigurationWidget::baseEnvironmentChanged() +{ + if (m_ignoreChange) + return; + + int index = CustomExecutableRunConfiguration::BaseEnvironmentBase( + m_runConfiguration->baseEnvironmentBase()); + m_baseEnvironmentComboBox->setCurrentIndex(index); + m_environmentWidget->setBaseEnvironment(m_runConfiguration->baseEnvironment()); + m_environmentWidget->setBaseEnvironmentText(m_runConfiguration->baseEnvironmentText()); +} + +void CustomExecutableConfigurationWidget::userEnvironmentChangesChanged() +{ + m_environmentWidget->setUserChanges(m_runConfiguration->userEnvironmentChanges()); +} + + +void CustomExecutableConfigurationWidget::executableEdited() +{ + m_ignoreChange = true; + m_runConfiguration->setExecutable(m_executableChooser->rawPath()); + m_ignoreChange = false; +} +void CustomExecutableConfigurationWidget::argumentsEdited(const QString &arguments) +{ + m_ignoreChange = true; + m_runConfiguration->setCommandLineArguments(arguments); + m_ignoreChange = false; +} +void CustomExecutableConfigurationWidget::workingDirectoryEdited() +{ + m_ignoreChange = true; + m_runConfiguration->setBaseWorkingDirectory(m_workingDirectory->rawPath()); + m_ignoreChange = false; +} + +void CustomExecutableConfigurationWidget::termToggled(bool on) +{ + m_ignoreChange = true; + m_runConfiguration->setRunMode(on ? ProjectExplorer::LocalApplicationRunConfiguration::Console + : ProjectExplorer::LocalApplicationRunConfiguration::Gui); + m_ignoreChange = false; +} + +void CustomExecutableConfigurationWidget::changed() +{ + // We triggered the change, don't update us + if (m_ignoreChange) + return; + + m_executableChooser->setPath(m_runConfiguration->rawExecutable()); + m_commandLineArgumentsLineEdit->setText(m_runConfiguration->rawCommandLineArguments()); + m_workingDirectory->setPath(m_runConfiguration->baseWorkingDirectory()); + m_useTerminalCheck->setChecked(m_runConfiguration->runMode() + == ProjectExplorer::LocalApplicationRunConfiguration::Console); +} + +} // namespace Internal +} // namespace QtSupport diff --git a/src/plugins/qtsupport/customexecutableconfigurationwidget.h b/src/plugins/qtsupport/customexecutableconfigurationwidget.h new file mode 100644 index 0000000000..95faf74543 --- /dev/null +++ b/src/plugins/qtsupport/customexecutableconfigurationwidget.h @@ -0,0 +1,93 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** Other Usage +** +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +**************************************************************************/ + +#ifndef CUSTOMEXECUTABLECONFIGURATIONWIDGET_H +#define CUSTOMEXECUTABLECONFIGURATIONWIDGET_H + +#include + +QT_BEGIN_NAMESPACE +class QCheckBox; +class QLineEdit; +class QComboBox; +class QLabel; +class QAbstractButton; +QT_END_NAMESPACE + +namespace Utils { +class DetailsWidget; +class PathChooser; +} + +namespace ProjectExplorer { class EnvironmentWidget; } +namespace QtSupport { +class CustomExecutableRunConfiguration; + +namespace Internal { + +class CustomExecutableConfigurationWidget : public QWidget +{ + Q_OBJECT + +public: + CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc); + +private slots: + void changed(); + + void executableEdited(); + void argumentsEdited(const QString &arguments); + void workingDirectoryEdited(); + void termToggled(bool); + + void userChangesChanged(); + void baseEnvironmentChanged(); + void userEnvironmentChangesChanged(); + void baseEnvironmentSelected(int index); + +private: + bool m_ignoreChange; + CustomExecutableRunConfiguration *m_runConfiguration; + Utils::PathChooser *m_executableChooser; + QLineEdit *m_userName; + QLineEdit *m_commandLineArgumentsLineEdit; + Utils::PathChooser *m_workingDirectory; + QCheckBox *m_useTerminalCheck; + ProjectExplorer::EnvironmentWidget *m_environmentWidget; + QComboBox *m_baseEnvironmentComboBox; + Utils::DetailsWidget *m_detailsContainer; +}; + +} // namespace Internal +} // namespace QtSupport + +#endif // CUSTOMEXECUTABLECONFIGURATIONWIDGET_H diff --git a/src/plugins/qtsupport/customexecutablerunconfiguration.cpp b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp new file mode 100644 index 0000000000..ddd678155c --- /dev/null +++ b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp @@ -0,0 +1,424 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** Other Usage +** +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +**************************************************************************/ + +#include "customexecutablerunconfiguration.h" +#include "customexecutableconfigurationwidget.h" +#include "debugginghelper.h" + +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include + +using namespace QtSupport; +using namespace QtSupport::Internal; + +namespace { +const char * const CUSTOM_EXECUTABLE_ID("ProjectExplorer.CustomExecutableRunConfiguration"); + +const char * const EXECUTABLE_KEY("ProjectExplorer.CustomExecutableRunConfiguration.Executable"); +const char * const ARGUMENTS_KEY("ProjectExplorer.CustomExecutableRunConfiguration.Arguments"); +const char * const WORKING_DIRECTORY_KEY("ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory"); +const char * const USE_TERMINAL_KEY("ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal"); +const char * const USER_ENVIRONMENT_CHANGES_KEY("ProjectExplorer.CustomExecutableRunConfiguration.UserEnvironmentChanges"); +const char * const BASE_ENVIRONMENT_BASE_KEY("ProjectExplorer.CustomExecutableRunConfiguration.BaseEnvironmentBase"); +} + +void CustomExecutableRunConfiguration::ctor() +{ + setDefaultDisplayName(defaultDisplayName()); + + connect(target(), SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)), + this, SLOT(activeBuildConfigurationChanged())); + + m_lastActiveBuildConfiguration = activeBuildConfiguration(); + + if (m_lastActiveBuildConfiguration) { + connect(m_lastActiveBuildConfiguration, SIGNAL(environmentChanged()), + this, SIGNAL(baseEnvironmentChanged())); + } +} + +CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(ProjectExplorer::Target *parent) : + ProjectExplorer::LocalApplicationRunConfiguration(parent, Core::Id(CUSTOM_EXECUTABLE_ID)), + m_workingDirectory(QLatin1String(ProjectExplorer::Constants::DEFAULT_WORKING_DIR)), + m_runMode(Gui), + m_baseEnvironmentBase(CustomExecutableRunConfiguration::BuildEnvironmentBase) +{ + ctor(); +} + +CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(ProjectExplorer::Target *parent, + CustomExecutableRunConfiguration *source) : + ProjectExplorer::LocalApplicationRunConfiguration(parent, source), + m_executable(source->m_executable), + m_workingDirectory(source->m_workingDirectory), + m_cmdArguments(source->m_cmdArguments), + m_runMode(source->m_runMode), + m_userEnvironmentChanges(source->m_userEnvironmentChanges), + m_baseEnvironmentBase(source->m_baseEnvironmentBase) +{ + ctor(); +} + +// Note: Qt4Project deletes all empty customexecrunconfigs for which isConfigured() == false. +CustomExecutableRunConfiguration::~CustomExecutableRunConfiguration() +{ +} + +void CustomExecutableRunConfiguration::activeBuildConfigurationChanged() +{ + if (m_lastActiveBuildConfiguration) { + disconnect(m_lastActiveBuildConfiguration, SIGNAL(environmentChanged()), + this, SIGNAL(baseEnvironmentChanged())); + } + m_lastActiveBuildConfiguration = activeBuildConfiguration(); + if (m_lastActiveBuildConfiguration) { + connect(m_lastActiveBuildConfiguration, SIGNAL(environmentChanged()), + this, SIGNAL(baseEnvironmentChanged())); + } +} + +QString CustomExecutableRunConfiguration::executable() const +{ + Utils::Environment env = environment(); + QString exec = env.searchInPath(Utils::expandMacros(m_executable, macroExpander()), + QStringList() << workingDirectory()); + + if (exec.isEmpty() || !QFileInfo(exec).exists()) { + // Oh the executable doesn't exists, ask the user. + CustomExecutableRunConfiguration *that = const_cast(this); + QWidget *confWidget = that->createConfigurationWidget(); + confWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + QDialog dialog(Core::ICore::mainWindow()); + dialog.setWindowTitle(displayName()); + dialog.setWindowFlags(dialog.windowFlags() & ~Qt::WindowContextHelpButtonHint); + dialog.setLayout(new QVBoxLayout()); + QLabel *label = new QLabel(tr("Could not find the executable, please specify one.")); + label->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + dialog.layout()->addWidget(label); + dialog.layout()->addWidget(confWidget); + QDialogButtonBox *dbb = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + connect(dbb, SIGNAL(accepted()), &dialog, SLOT(accept())); + connect(dbb, SIGNAL(rejected()), &dialog, SLOT(reject())); + dialog.layout()->addWidget(dbb); + dialog.layout()->setSizeConstraint(QLayout::SetMinAndMaxSize); + + QString oldExecutable = m_executable; + QString oldWorkingDirectory = m_workingDirectory; + QString oldCmdArguments = m_cmdArguments; + + if (dialog.exec() == QDialog::Accepted) { + return executable(); + } else { + // Restore values changed by the configuration widget. + if (that->m_executable != oldExecutable + || that->m_workingDirectory != oldWorkingDirectory + || that->m_cmdArguments != oldCmdArguments) { + that->m_executable = oldExecutable; + that->m_workingDirectory = oldWorkingDirectory; + that->m_cmdArguments = oldCmdArguments; + emit that->changed(); + } + return QString(); + } + } + return QDir::cleanPath(exec); +} + +QString CustomExecutableRunConfiguration::rawExecutable() const +{ + return m_executable; +} + +bool CustomExecutableRunConfiguration::isConfigured() const +{ + return !m_executable.isEmpty(); +} + +ProjectExplorer::LocalApplicationRunConfiguration::RunMode CustomExecutableRunConfiguration::runMode() const +{ + return m_runMode; +} + +QString CustomExecutableRunConfiguration::workingDirectory() const +{ + return QDir::cleanPath(environment().expandVariables( + Utils::expandMacros(baseWorkingDirectory(), macroExpander()))); +} + +QString CustomExecutableRunConfiguration::baseWorkingDirectory() const +{ + return m_workingDirectory; +} + + +QString CustomExecutableRunConfiguration::commandLineArguments() const +{ + return Utils::QtcProcess::expandMacros(m_cmdArguments, macroExpander()); +} + +QString CustomExecutableRunConfiguration::rawCommandLineArguments() const +{ + return m_cmdArguments; +} + +QString CustomExecutableRunConfiguration::baseEnvironmentText() const +{ + if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::CleanEnvironmentBase) { + return tr("Clean Environment"); + } else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::SystemEnvironmentBase) { + return tr("System Environment"); + } else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::BuildEnvironmentBase) { + return tr("Build Environment"); + } + return QString(); +} + +Utils::Environment CustomExecutableRunConfiguration::baseEnvironment() const +{ + Utils::Environment env; + if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::CleanEnvironmentBase) { + // Nothing + } else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::SystemEnvironmentBase) { + env = Utils::Environment::systemEnvironment(); + } else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::BuildEnvironmentBase) { + if (activeBuildConfiguration()) + env = activeBuildConfiguration()->environment(); + } + return env; +} + +void CustomExecutableRunConfiguration::setBaseEnvironmentBase(BaseEnvironmentBase env) +{ + if (m_baseEnvironmentBase == env) + return; + m_baseEnvironmentBase = env; + emit baseEnvironmentChanged(); +} + +CustomExecutableRunConfiguration::BaseEnvironmentBase CustomExecutableRunConfiguration::baseEnvironmentBase() const +{ + return m_baseEnvironmentBase; +} + +Utils::Environment CustomExecutableRunConfiguration::environment() const +{ + Utils::Environment env = baseEnvironment(); + env.modify(userEnvironmentChanges()); + return env; +} + +QList CustomExecutableRunConfiguration::userEnvironmentChanges() const +{ + return m_userEnvironmentChanges; +} + +void CustomExecutableRunConfiguration::setUserEnvironmentChanges(const QList &diff) +{ + if (m_userEnvironmentChanges != diff) { + m_userEnvironmentChanges = diff; + emit userEnvironmentChangesChanged(diff); + } +} + +QString CustomExecutableRunConfiguration::defaultDisplayName() const +{ + if (m_executable.isEmpty()) + return tr("Custom Executable"); + else + return tr("Run %1").arg(QDir::toNativeSeparators(m_executable)); +} + +QVariantMap CustomExecutableRunConfiguration::toMap() const +{ + QVariantMap map(LocalApplicationRunConfiguration::toMap()); + map.insert(QLatin1String(EXECUTABLE_KEY), m_executable); + map.insert(QLatin1String(ARGUMENTS_KEY), m_cmdArguments); + map.insert(QLatin1String(WORKING_DIRECTORY_KEY), m_workingDirectory); + map.insert(QLatin1String(USE_TERMINAL_KEY), m_runMode == Console); + map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), Utils::EnvironmentItem::toStringList(m_userEnvironmentChanges)); + map.insert(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast(m_baseEnvironmentBase)); + return map; +} + +bool CustomExecutableRunConfiguration::fromMap(const QVariantMap &map) +{ + m_executable = map.value(QLatin1String(EXECUTABLE_KEY)).toString(); + m_cmdArguments = map.value(QLatin1String(ARGUMENTS_KEY)).toString(); + m_workingDirectory = map.value(QLatin1String(WORKING_DIRECTORY_KEY)).toString(); + m_runMode = map.value(QLatin1String(USE_TERMINAL_KEY)).toBool() ? Console : Gui; + m_userEnvironmentChanges = Utils::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList()); + m_baseEnvironmentBase = static_cast(map.value(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast(CustomExecutableRunConfiguration::BuildEnvironmentBase)).toInt()); + + setDefaultDisplayName(defaultDisplayName()); + return LocalApplicationRunConfiguration::fromMap(map); +} + +void CustomExecutableRunConfiguration::setExecutable(const QString &executable) +{ + if (executable == m_executable) + return; + m_executable = executable; + setDefaultDisplayName(defaultDisplayName()); + emit changed(); +} + +void CustomExecutableRunConfiguration::setCommandLineArguments(const QString &commandLineArguments) +{ + m_cmdArguments = commandLineArguments; + emit changed(); +} + +void CustomExecutableRunConfiguration::setBaseWorkingDirectory(const QString &workingDirectory) +{ + m_workingDirectory = workingDirectory; + emit changed(); +} + +void CustomExecutableRunConfiguration::setRunMode(ProjectExplorer::LocalApplicationRunConfiguration::RunMode runMode) +{ + m_runMode = runMode; + emit changed(); +} + +QWidget *CustomExecutableRunConfiguration::createConfigurationWidget() +{ + return new CustomExecutableConfigurationWidget(this); +} + +QString CustomExecutableRunConfiguration::dumperLibrary() const +{ + Utils::FileName qmakePath = DebuggingHelperLibrary::findSystemQt(environment()); + QString qtInstallData = DebuggingHelperLibrary::qtInstallDataDir(qmakePath); + return DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(qtInstallData); +} + +QStringList CustomExecutableRunConfiguration::dumperLibraryLocations() const +{ + Utils::FileName qmakePath = DebuggingHelperLibrary::findSystemQt(environment()); + QString qtInstallData = DebuggingHelperLibrary::qtInstallDataDir(qmakePath); + return DebuggingHelperLibrary::debuggingHelperLibraryDirectories(qtInstallData); +} + +ProjectExplorer::Abi CustomExecutableRunConfiguration::abi() const +{ + return ProjectExplorer::Abi(); // return an invalid ABI: We do not know what we will end up running! +} + +// Factory + +CustomExecutableRunConfigurationFactory::CustomExecutableRunConfigurationFactory(QObject *parent) : + ProjectExplorer::IRunConfigurationFactory(parent) +{ +} + +CustomExecutableRunConfigurationFactory::~CustomExecutableRunConfigurationFactory() +{ + +} + +bool CustomExecutableRunConfigurationFactory::canCreate(ProjectExplorer::Target *parent, + const Core::Id id) const +{ + Q_UNUSED(parent); + return id == Core::Id(CUSTOM_EXECUTABLE_ID); +} + +ProjectExplorer::RunConfiguration * +CustomExecutableRunConfigurationFactory::create(ProjectExplorer::Target *parent, const Core::Id id) +{ + if (!canCreate(parent, id)) + return 0; + + return new CustomExecutableRunConfiguration(parent); +} + +bool CustomExecutableRunConfigurationFactory::canRestore(ProjectExplorer::Target *parent, + const QVariantMap &map) const +{ + Core::Id id(ProjectExplorer::idFromMap(map)); + return canCreate(parent, id); +} + +ProjectExplorer::RunConfiguration * +CustomExecutableRunConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map) +{ + if (!canRestore(parent, map)) + return 0; + CustomExecutableRunConfiguration *rc(new CustomExecutableRunConfiguration(parent)); + if (rc->fromMap(map)) + return rc; + delete rc; + return 0; +} + +bool CustomExecutableRunConfigurationFactory::canClone(ProjectExplorer::Target *parent, + ProjectExplorer::RunConfiguration *source) const +{ + return canCreate(parent, source->id()); +} + +ProjectExplorer::RunConfiguration * +CustomExecutableRunConfigurationFactory::clone(ProjectExplorer::Target *parent, + ProjectExplorer::RunConfiguration *source) +{ + if (!canClone(parent, source)) + return 0; + return new CustomExecutableRunConfiguration(parent, static_cast(source)); +} + +QList CustomExecutableRunConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const +{ + Q_UNUSED(parent) + return QList() << Core::Id(CUSTOM_EXECUTABLE_ID); +} + +QString CustomExecutableRunConfigurationFactory::displayNameForId(const Core::Id id) const +{ + if (id == Core::Id(CUSTOM_EXECUTABLE_ID)) + return tr("Custom Executable"); + return QString(); +} diff --git a/src/plugins/qtsupport/customexecutablerunconfiguration.h b/src/plugins/qtsupport/customexecutablerunconfiguration.h new file mode 100644 index 0000000000..17542ba38b --- /dev/null +++ b/src/plugins/qtsupport/customexecutablerunconfiguration.h @@ -0,0 +1,155 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** Other Usage +** +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +**************************************************************************/ + +#ifndef CUSTOMEXECUTABLERUNCONFIGURATION_H +#define CUSTOMEXECUTABLERUNCONFIGURATION_H + +#include "qtsupport_global.h" + +#include + +#include + +#include + +namespace ProjectExplorer { class Target; } + +namespace QtSupport { +namespace Internal { class CustomExecutableConfigurationWidget; } + +class CustomExecutableRunConfigurationFactory; + +class QTSUPPORT_EXPORT CustomExecutableRunConfiguration : public ProjectExplorer::LocalApplicationRunConfiguration +{ + Q_OBJECT + // the configuration widget needs to setExecutable setWorkingDirectory and setCommandLineArguments + friend class Internal::CustomExecutableConfigurationWidget; + friend class CustomExecutableRunConfigurationFactory; + +public: + explicit CustomExecutableRunConfiguration(ProjectExplorer::Target *parent); + ~CustomExecutableRunConfiguration(); + + /** + * Returns the executable, looks in the environment for it and might even + * ask the user if none is specified + */ + QString executable() const; + + /** Returns whether this runconfiguration ever was configured with a executable + */ + bool isConfigured() const; + + RunMode runMode() const; + QString workingDirectory() const; + QString commandLineArguments() const; + Utils::Environment environment() const; + + QWidget *createConfigurationWidget(); + QString dumperLibrary() const; + QStringList dumperLibraryLocations() const; + + ProjectExplorer::Abi abi() const; + + QVariantMap toMap() const; + +signals: + void changed(); + + void baseEnvironmentChanged(); + void userEnvironmentChangesChanged(const QList &diff); + +private slots: + void activeBuildConfigurationChanged(); + +protected: + CustomExecutableRunConfiguration(ProjectExplorer::Target *parent, + CustomExecutableRunConfiguration *source); + virtual bool fromMap(const QVariantMap &map); + QString defaultDisplayName() const; + +private: + void ctor(); + + enum BaseEnvironmentBase { CleanEnvironmentBase = 0, + SystemEnvironmentBase = 1, + BuildEnvironmentBase = 2}; + void setBaseEnvironmentBase(BaseEnvironmentBase env); + BaseEnvironmentBase baseEnvironmentBase() const; + Utils::Environment baseEnvironment() const; + QString baseEnvironmentText() const; + void setUserEnvironmentChanges(const QList &diff); + QList userEnvironmentChanges() const; + + void setExecutable(const QString &executable); + QString rawExecutable() const; + void setCommandLineArguments(const QString &commandLineArguments); + QString rawCommandLineArguments() const; + void setBaseWorkingDirectory(const QString &workingDirectory); + QString baseWorkingDirectory() const; + void setUserName(const QString &name); + void setRunMode(ProjectExplorer::LocalApplicationRunConfiguration::RunMode runMode); + + QString m_executable; + QString m_workingDirectory; + QString m_cmdArguments; + RunMode m_runMode; + bool m_userSetName; + QString m_userName; + QList m_userEnvironmentChanges; + BaseEnvironmentBase m_baseEnvironmentBase; + ProjectExplorer::BuildConfiguration *m_lastActiveBuildConfiguration; +}; + +class CustomExecutableRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory +{ + Q_OBJECT + +public: + explicit CustomExecutableRunConfigurationFactory(QObject *parent = 0); + ~CustomExecutableRunConfigurationFactory(); + + QList availableCreationIds(ProjectExplorer::Target *parent) const; + QString displayNameForId(const Core::Id id) const; + + bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; + ProjectExplorer::RunConfiguration *create(ProjectExplorer::Target *parent, const Core::Id id); + bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; + ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map); + bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product) const; + ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, + ProjectExplorer::RunConfiguration *source); +}; + +} // namespace QtSupport + +#endif // CUSTOMEXECUTABLERUNCONFIGURATION_H diff --git a/src/plugins/qtsupport/debugginghelper.cpp b/src/plugins/qtsupport/debugginghelper.cpp new file mode 100644 index 0000000000..250e755708 --- /dev/null +++ b/src/plugins/qtsupport/debugginghelper.cpp @@ -0,0 +1,122 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** Other Usage +** +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +**************************************************************************/ + +#include "debugginghelper.h" + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace QtSupport; + +static inline QStringList validBinaryFilenames() +{ + return QStringList() + << QLatin1String("debug/dumper.dll") + << QLatin1String("libdumper.dylib") + << QLatin1String("libdumper.so"); +} + +QStringList DebuggingHelperLibrary::debuggingHelperLibraryDirectories(const QString &qtInstallData) +{ + const QChar slash = QLatin1Char('/'); + const uint hash = qHash(qtInstallData); + QStringList directories; + directories + << (qtInstallData + QLatin1String("/qtc-debugging-helper/")) + << QDir::cleanPath((QCoreApplication::applicationDirPath() + QLatin1String("/../qtc-debugging-helper/") + QString::number(hash))) + slash + << (QDesktopServices::storageLocation(QDesktopServices::DataLocation) + QLatin1String("/qtc-debugging-helper/") + QString::number(hash)) + slash; + return directories; +} + +static QString sourcePath() +{ + return Core::ICore::resourcePath() + QLatin1String("/dumper/"); +} + +static QStringList sourceFileNames() +{ + return QStringList() + << QLatin1String("dumper.cpp") << QLatin1String("dumper_p.h") + << QLatin1String("dumper.h") << QLatin1String("dumper.pro") + << QLatin1String("LICENSE.LGPL") << QLatin1String("LGPL_EXCEPTION.TXT"); +} + +QString DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(const QString &qtInstallData) +{ + if (!Core::ICore::instance()) + return QString(); + + const QStringList directories = DebuggingHelperLibrary::debuggingHelperLibraryDirectories(qtInstallData); + const QStringList binFilenames = validBinaryFilenames(); + + return byInstallDataHelper(sourcePath(), sourceFileNames(), directories, binFilenames, false); +} + +QString DebuggingHelperLibrary::copy(const QString &qtInstallData, + QString *errorMessage) +{ + // Locations to try: + // $QTDIR/qtc-debugging-helper + // $APPLICATION-DIR/qtc-debugging-helper/$hash + // $USERDIR/qtc-debugging-helper/$hash + const QStringList directories = DebuggingHelperLibrary::debuggingHelperLibraryDirectories(qtInstallData); + + // Try to find a writeable directory. + foreach(const QString &directory, directories) + if (copyFiles(sourcePath(), sourceFileNames(), directory, errorMessage)) { + errorMessage->clear(); + return directory; + } + *errorMessage = QCoreApplication::translate("ProjectExplorer::DebuggingHelperLibrary", + "The debugger helpers could not be built in any of the directories:\n- %1\n\nReason: %2") + .arg(directories.join(QLatin1String("\n- ")), *errorMessage); + return QString(); +} + +bool DebuggingHelperLibrary::build(BuildHelperArguments arguments, QString *log, QString *errorMessage) +{ + arguments.proFilename = QLatin1String("dumper.pro"); + arguments.helperName = QCoreApplication::translate("ProjectExplorer::DebuggingHelperLibrary", + "GDB helper"); + return buildHelper(arguments, log, errorMessage); +} diff --git a/src/plugins/qtsupport/debugginghelper.h b/src/plugins/qtsupport/debugginghelper.h new file mode 100644 index 0000000000..e2b0001467 --- /dev/null +++ b/src/plugins/qtsupport/debugginghelper.h @@ -0,0 +1,61 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** Other Usage +** +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +**************************************************************************/ + +#ifndef DEBUGGINGHELPER_H +#define DEBUGGINGHELPER_H + +#include "qtsupport_global.h" + +#include + +#include + +QT_FORWARD_DECLARE_CLASS(QStringList) + +namespace QtSupport { + +class QTSUPPORT_EXPORT DebuggingHelperLibrary : public Utils::BuildableHelperLibrary +{ +public: + static QString debuggingHelperLibraryByInstallData(const QString &qtInstallData); + static QStringList debuggingHelperLibraryDirectories(const QString &qtInstallData); + + // Build the helpers and return the output log/errormessage. + static bool build(BuildHelperArguments arguments, QString *log, QString *errorMessage); + + // Copy the source files to a target location and return the chosen target location. + static QString copy(const QString &qtInstallData, QString *errorMessage); + +}; +} // namespace QtSupport + +#endif // DEBUGGINGHELPER_H diff --git a/src/plugins/qtsupport/debugginghelperbuildtask.cpp b/src/plugins/qtsupport/debugginghelperbuildtask.cpp index eccf0d37d0..bf7c7ae1f9 100644 --- a/src/plugins/qtsupport/debugginghelperbuildtask.cpp +++ b/src/plugins/qtsupport/debugginghelperbuildtask.cpp @@ -31,6 +31,7 @@ **************************************************************************/ #include "debugginghelperbuildtask.h" +#include "debugginghelper.h" #include "qmldumptool.h" #include "qmlobservertool.h" #include "qmldebugginglibrary.h" @@ -40,7 +41,6 @@ #include #include #include -#include #include #include diff --git a/src/plugins/qtsupport/qtsupport.pro b/src/plugins/qtsupport/qtsupport.pro index 383c154a42..e225359e54 100644 --- a/src/plugins/qtsupport/qtsupport.pro +++ b/src/plugins/qtsupport/qtsupport.pro @@ -26,6 +26,9 @@ HEADERS += \ qmlobservertool.h \ qmldebugginglibrary.h \ qtoptionspage.h \ + customexecutablerunconfiguration.h \ + customexecutableconfigurationwidget.h \ + debugginghelper.h \ debugginghelperbuildtask.h \ qtsupportconstants.h \ profilereader.h \ @@ -44,6 +47,9 @@ SOURCES += \ qmlobservertool.cpp \ qmldebugginglibrary.cpp \ qtoptionspage.cpp \ + customexecutablerunconfiguration.cpp \ + customexecutableconfigurationwidget.cpp \ + debugginghelper.cpp \ debugginghelperbuildtask.cpp \ profilereader.cpp \ qtparser.cpp \ diff --git a/src/plugins/qtsupport/qtsupport.qbs b/src/plugins/qtsupport/qtsupport.qbs index 69151a700b..04ffb0989d 100644 --- a/src/plugins/qtsupport/qtsupport.qbs +++ b/src/plugins/qtsupport/qtsupport.qbs @@ -47,6 +47,8 @@ QtcPlugin { "qtversioninfo.ui", "qtversionmanager.ui", "baseqtversion.h", + "debugginghelper.cpp", + "debugginghelper.h", "debugginghelper.ui", "debugginghelperbuildtask.h", "exampleslistmodel.h", @@ -70,6 +72,10 @@ QtcPlugin { "screenshotcropper.h", "showbuildlog.ui", "baseqtversion.cpp", + "customexecutableconfigurationwidget.cpp", + "customexecutableconfigurationwidget.h", + "customexecutablerunconfiguration.cpp", + "customexecutablerunconfiguration.h", "debugginghelperbuildtask.cpp", "exampleslistmodel.cpp", "gettingstartedwelcomepage.cpp", diff --git a/src/plugins/qtsupport/qtsupportplugin.cpp b/src/plugins/qtsupport/qtsupportplugin.cpp index 1ba5aa29ed..d1f0872196 100644 --- a/src/plugins/qtsupport/qtsupportplugin.cpp +++ b/src/plugins/qtsupport/qtsupportplugin.cpp @@ -32,6 +32,7 @@ #include "qtsupportplugin.h" +#include "customexecutablerunconfiguration.h" #include "qtoptionspage.h" #include "qtversionmanager.h" @@ -74,6 +75,8 @@ bool QtSupportPlugin::initialize(const QStringList &arguments, QString *errorMes GettingStartedWelcomePage *gettingStartedWelcomePage = new GettingStartedWelcomePage; addAutoReleasedObject(gettingStartedWelcomePage); + addAutoReleasedObject(new CustomExecutableRunConfigurationFactory); + return true; } diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index b70b7c4fa8..c5988bc251 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -36,12 +36,12 @@ #include "qtsupportconstants.h" -#include // only for legay restore #include #include #include +#include #include #include @@ -69,8 +69,6 @@ using namespace QtSupport; using namespace QtSupport::Internal; -using ProjectExplorer::DebuggingHelperLibrary; - static const char QTVERSION_DATA_KEY[] = "QtVersion."; static const char QTVERSION_TYPE_KEY[] = "QtVersion.Type"; static const char QTVERSION_COUNT_KEY[] = "QtVersion.Count"; @@ -413,7 +411,7 @@ void QtVersionManager::saveQtVersions() void QtVersionManager::findSystemQt() { - Utils::FileName systemQMakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(Utils::Environment::systemEnvironment()); + Utils::FileName systemQMakePath = QtSupport::DebuggingHelperLibrary::findSystemQt(Utils::Environment::systemEnvironment()); if (systemQMakePath.isNull()) return; diff --git a/src/plugins/remotelinux/embeddedlinuxtargetfactory.cpp b/src/plugins/remotelinux/embeddedlinuxtargetfactory.cpp index ce4474918e..a9eb98b01d 100644 --- a/src/plugins/remotelinux/embeddedlinuxtargetfactory.cpp +++ b/src/plugins/remotelinux/embeddedlinuxtargetfactory.cpp @@ -37,12 +37,11 @@ #include "genericembeddedlinuxtarget.h" #include "remotelinux_constants.h" -#include - #include #include #include +#include #include #include @@ -169,7 +168,7 @@ ProjectExplorer::Target *EmbeddedLinuxTargetFactory::create(ProjectExplorer::Pro t->createApplicationProFiles(false); if (t->runConfigurations().isEmpty()) - t->addRunConfiguration(new ProjectExplorer::CustomExecutableRunConfiguration(t)); + t->addRunConfiguration(new QtSupport::CustomExecutableRunConfiguration(t)); return t; } diff --git a/src/plugins/remotelinux/genericembeddedlinuxtarget.cpp b/src/plugins/remotelinux/genericembeddedlinuxtarget.cpp index 978504c219..4cd46186b8 100644 --- a/src/plugins/remotelinux/genericembeddedlinuxtarget.cpp +++ b/src/plugins/remotelinux/genericembeddedlinuxtarget.cpp @@ -35,12 +35,12 @@ #include "remotelinux_constants.h" #include "remotelinuxrunconfiguration.h" -#include #include #include #include #include #include +#include #include @@ -102,7 +102,7 @@ void GenericEmbeddedLinuxTarget::createApplicationProFiles(bool reparse) // Oh still none? Add a custom executable runconfiguration if (runConfigurations().isEmpty()) - addRunConfiguration(new ProjectExplorer::CustomExecutableRunConfiguration(this)); + addRunConfiguration(new QtSupport::CustomExecutableRunConfiguration(this)); } } // namespace Internal -- cgit v1.2.1