2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** Copyright (C) 2015 The Qt Company Ltd.
|
|
|
|
|
** Contact: http://www.qt.io/licensing
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2015-01-14 18:07:15 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms and
|
|
|
|
|
** conditions see http://www.qt.io/terms-conditions. For further information
|
2014-10-01 13:21:18 +02:00
|
|
|
** use the contact form at http://www.qt.io/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2014-10-01 13:21:18 +02:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2012-10-02 09:12:39 +02:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** In addition, as a special exception, The Qt Company gives you certain additional
|
|
|
|
|
** rights. These rights are described in The Qt Company LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
#include "desktopqmakerunconfiguration.h"
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2013-10-16 12:10:22 +02:00
|
|
|
#include "qmakenodes.h"
|
|
|
|
|
#include "qmakeproject.h"
|
|
|
|
|
#include "qmakebuildconfiguration.h"
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-11-23 16:41:54 +01:00
|
|
|
#include <coreplugin/coreicons.h>
|
2014-11-05 16:23:34 +01:00
|
|
|
#include <coreplugin/variablechooser.h>
|
2013-01-29 18:00:30 +01:00
|
|
|
#include <projectexplorer/localenvironmentaspect.h>
|
2015-04-30 14:52:41 +02:00
|
|
|
#include <projectexplorer/runconfigurationaspects.h>
|
2012-04-24 15:49:09 +02:00
|
|
|
#include <projectexplorer/target.h>
|
2013-10-29 17:48:43 +01:00
|
|
|
#include <qtsupport/qtkitinformation.h>
|
2011-05-20 21:40:53 +02:00
|
|
|
#include <qtsupport/qtoutputformatter.h>
|
2012-04-24 15:49:09 +02:00
|
|
|
#include <qtsupport/qtsupportconstants.h>
|
2015-01-10 23:40:32 +02:00
|
|
|
|
2013-10-29 17:48:43 +01:00
|
|
|
#include <utils/detailswidget.h>
|
2015-01-10 23:40:32 +02:00
|
|
|
#include <utils/fileutils.h>
|
2012-08-23 15:53:58 +02:00
|
|
|
#include <utils/hostosinfo.h>
|
2013-10-29 17:48:43 +01:00
|
|
|
#include <utils/pathchooser.h>
|
|
|
|
|
#include <utils/persistentsettings.h>
|
|
|
|
|
#include <utils/qtcprocess.h>
|
|
|
|
|
#include <utils/stringutils.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-10-29 17:48:43 +01:00
|
|
|
#include <QCheckBox>
|
|
|
|
|
#include <QComboBox>
|
|
|
|
|
#include <QDir>
|
|
|
|
|
#include <QFileInfo>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QFormLayout>
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
#include <QLineEdit>
|
|
|
|
|
#include <QToolButton>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-10-29 17:48:43 +01:00
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
using namespace Utils;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-10-29 17:48:43 +01:00
|
|
|
namespace QmakeProjectManager {
|
|
|
|
|
namespace Internal {
|
2010-01-19 13:41:02 +01:00
|
|
|
|
2013-10-29 16:08:37 +01:00
|
|
|
const char QMAKE_RC_PREFIX[] = "Qt4ProjectManager.Qt4RunConfiguration:";
|
2013-03-21 16:23:17 +01:00
|
|
|
const char PRO_FILE_KEY[] = "Qt4ProjectManager.Qt4RunConfiguration.ProFile";
|
|
|
|
|
const char USE_DYLD_IMAGE_SUFFIX_KEY[] = "Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix";
|
2015-09-02 17:11:31 +02:00
|
|
|
const char USE_LIBRARY_SEARCH_PATH[] = "QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath";
|
2010-01-19 13:41:02 +01:00
|
|
|
|
2015-02-02 00:37:38 +02:00
|
|
|
static Utils::FileName pathFromId(Core::Id id)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2015-02-02 00:37:38 +02:00
|
|
|
return Utils::FileName::fromString(id.suffixAfter(QMAKE_RC_PREFIX));
|
2010-01-19 13:41:02 +01:00
|
|
|
}
|
2009-03-19 15:04:43 +01:00
|
|
|
|
2010-01-19 13:41:02 +01:00
|
|
|
//
|
2013-10-29 17:48:43 +01:00
|
|
|
// QmakeRunConfiguration
|
2010-01-19 13:41:02 +01:00
|
|
|
//
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
DesktopQmakeRunConfiguration::DesktopQmakeRunConfiguration(Target *parent, Core::Id id) :
|
2012-04-24 15:49:09 +02:00
|
|
|
LocalApplicationRunConfiguration(parent, id),
|
2015-06-18 15:14:06 +02:00
|
|
|
m_proFilePath(pathFromId(id))
|
2010-01-19 13:41:02 +01:00
|
|
|
{
|
2015-04-30 14:52:41 +02:00
|
|
|
addExtraAspect(new LocalEnvironmentAspect(this));
|
|
|
|
|
addExtraAspect(new ArgumentsAspect(this, QStringLiteral("Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments")));
|
2015-05-18 16:18:49 +02:00
|
|
|
addExtraAspect(new TerminalAspect(this, QStringLiteral("Qt4ProjectManager.Qt4RunConfiguration.UseTerminal")));
|
2015-12-18 14:57:23 +01:00
|
|
|
addExtraAspect(new WorkingDirectoryAspect(this,
|
|
|
|
|
QStringLiteral("Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory")));
|
2013-11-01 14:13:41 +01:00
|
|
|
|
2013-10-29 14:22:31 +01:00
|
|
|
QmakeProject *project = static_cast<QmakeProject *>(parent->project());
|
2012-04-24 15:49:09 +02:00
|
|
|
m_parseSuccess = project->validParse(m_proFilePath);
|
|
|
|
|
m_parseInProgress = project->parseInProgress(m_proFilePath);
|
|
|
|
|
|
2010-01-19 13:41:02 +01:00
|
|
|
ctor();
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
DesktopQmakeRunConfiguration::DesktopQmakeRunConfiguration(Target *parent, DesktopQmakeRunConfiguration *source) :
|
2010-01-19 13:41:02 +01:00
|
|
|
LocalApplicationRunConfiguration(parent, source),
|
|
|
|
|
m_proFilePath(source->m_proFilePath),
|
|
|
|
|
m_isUsingDyldImageSuffix(source->m_isUsingDyldImageSuffix),
|
2015-09-02 17:11:31 +02:00
|
|
|
m_isUsingLibrarySearchPath(source->m_isUsingLibrarySearchPath),
|
2011-06-10 15:37:10 +02:00
|
|
|
m_parseSuccess(source->m_parseSuccess),
|
|
|
|
|
m_parseInProgress(source->m_parseInProgress)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-01-19 13:41:02 +01:00
|
|
|
ctor();
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
bool DesktopQmakeRunConfiguration::isEnabled() const
|
2009-06-12 12:58:02 +02:00
|
|
|
{
|
2011-06-10 15:37:10 +02:00
|
|
|
return m_parseSuccess && !m_parseInProgress;
|
2009-06-12 12:58:02 +02:00
|
|
|
}
|
2009-01-27 18:23:02 +01:00
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
QString DesktopQmakeRunConfiguration::disabledReason() const
|
2011-05-26 16:30:35 +02:00
|
|
|
{
|
2011-06-10 15:37:10 +02:00
|
|
|
if (m_parseInProgress)
|
2014-04-17 14:09:47 +02:00
|
|
|
return tr("The .pro file \"%1\" is currently being parsed.")
|
2015-02-02 00:37:38 +02:00
|
|
|
.arg(m_proFilePath.fileName());
|
2012-05-09 12:44:37 +02:00
|
|
|
|
2011-05-26 16:30:35 +02:00
|
|
|
if (!m_parseSuccess)
|
2013-10-29 14:22:31 +01:00
|
|
|
return static_cast<QmakeProject *>(target()->project())->disabledReasonForRunConfiguration(m_proFilePath);
|
2011-05-26 16:30:35 +02:00
|
|
|
return QString();
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
void DesktopQmakeRunConfiguration::proFileUpdated(QmakeProFileNode *pro, bool success, bool parseInProgress)
|
2009-12-03 18:37:27 +01:00
|
|
|
{
|
2015-10-29 17:53:47 +01:00
|
|
|
if (m_proFilePath != pro->filePath())
|
2011-06-10 15:37:10 +02:00
|
|
|
return;
|
2010-10-27 16:27:22 +02:00
|
|
|
bool enabled = isEnabled();
|
2012-05-08 12:02:51 +02:00
|
|
|
QString reason = disabledReason();
|
2010-10-27 16:27:22 +02:00
|
|
|
m_parseSuccess = success;
|
2011-06-10 15:37:10 +02:00
|
|
|
m_parseInProgress = parseInProgress;
|
2012-05-08 12:02:51 +02:00
|
|
|
if (enabled != isEnabled() || reason != disabledReason())
|
2012-03-29 13:11:00 +02:00
|
|
|
emit enabledChanged();
|
2010-10-27 16:27:22 +02:00
|
|
|
|
2011-06-10 15:37:10 +02:00
|
|
|
if (!parseInProgress) {
|
|
|
|
|
emit effectiveTargetInformationChanged();
|
2015-08-12 11:16:36 +02:00
|
|
|
setDefaultDisplayName(defaultDisplayName());
|
2014-09-12 13:38:49 +02:00
|
|
|
LocalEnvironmentAspect *aspect = extraAspect<LocalEnvironmentAspect>();
|
|
|
|
|
QTC_ASSERT(aspect, return);
|
2013-01-29 18:00:30 +01:00
|
|
|
aspect->buildEnvironmentHasChanged();
|
2011-06-10 15:37:10 +02:00
|
|
|
}
|
2015-05-18 16:18:49 +02:00
|
|
|
|
|
|
|
|
TerminalAspect *terminalAspect = extraAspect<TerminalAspect>();
|
|
|
|
|
if (terminalAspect && !terminalAspect->isUserSet()) {
|
|
|
|
|
terminalAspect->setUseTerminal(pro->variableValue(ConfigVar).contains(QLatin1String("console"))
|
|
|
|
|
&& !pro->variableValue(QtVar).contains(QLatin1String("testlib")));
|
|
|
|
|
}
|
2009-12-03 18:37:27 +01:00
|
|
|
}
|
|
|
|
|
|
2014-09-12 13:38:49 +02:00
|
|
|
void DesktopQmakeRunConfiguration::proFileEvaluated()
|
|
|
|
|
{
|
|
|
|
|
// We depend on all .pro files for the LD_LIBRARY_PATH so we emit a signal for all .pro files
|
|
|
|
|
// This can be optimized by checking whether LD_LIBRARY_PATH changed
|
|
|
|
|
LocalEnvironmentAspect *aspect = extraAspect<LocalEnvironmentAspect>();
|
|
|
|
|
QTC_ASSERT(aspect, return);
|
|
|
|
|
aspect->buildEnvironmentHasChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
void DesktopQmakeRunConfiguration::ctor()
|
2010-01-19 13:41:02 +01:00
|
|
|
{
|
2010-08-19 12:26:21 +02:00
|
|
|
setDefaultDisplayName(defaultDisplayName());
|
2010-08-18 15:42:01 +02:00
|
|
|
|
2014-09-12 13:31:50 +02:00
|
|
|
QmakeProject *project = static_cast<QmakeProject *>(target()->project());
|
|
|
|
|
connect(project, &QmakeProject::proFileUpdated,
|
|
|
|
|
this, &DesktopQmakeRunConfiguration::proFileUpdated);
|
2014-09-12 13:38:49 +02:00
|
|
|
connect(project, &QmakeProject::proFilesEvaluated,
|
|
|
|
|
this, &DesktopQmakeRunConfiguration::proFileEvaluated);
|
2010-01-19 13:41:02 +01:00
|
|
|
}
|
|
|
|
|
|
2009-01-27 18:23:02 +01:00
|
|
|
//////
|
2013-10-29 18:14:50 +01:00
|
|
|
/// DesktopQmakeRunConfigurationWidget
|
2009-01-27 18:23:02 +01:00
|
|
|
/////
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
DesktopQmakeRunConfigurationWidget::DesktopQmakeRunConfigurationWidget(DesktopQmakeRunConfiguration *qmakeRunConfiguration, QWidget *parent)
|
2009-03-26 12:01:08 +01:00
|
|
|
: QWidget(parent),
|
2015-06-18 15:14:06 +02:00
|
|
|
m_qmakeRunConfiguration(qmakeRunConfiguration)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-10-01 14:24:44 +02:00
|
|
|
QVBoxLayout *vboxTopLayout = new QVBoxLayout(this);
|
|
|
|
|
vboxTopLayout->setMargin(0);
|
|
|
|
|
|
2011-06-10 15:37:10 +02:00
|
|
|
QHBoxLayout *hl = new QHBoxLayout();
|
|
|
|
|
hl->addStretch();
|
|
|
|
|
m_disabledIcon = new QLabel(this);
|
2015-11-23 16:41:54 +01:00
|
|
|
m_disabledIcon->setPixmap(Core::Icons::WARNING.pixmap());
|
2011-06-10 15:37:10 +02:00
|
|
|
hl->addWidget(m_disabledIcon);
|
|
|
|
|
m_disabledReason = new QLabel(this);
|
|
|
|
|
m_disabledReason->setVisible(false);
|
|
|
|
|
hl->addWidget(m_disabledReason);
|
|
|
|
|
hl->addStretch();
|
|
|
|
|
vboxTopLayout->addLayout(hl);
|
|
|
|
|
|
2013-10-29 17:48:43 +01:00
|
|
|
m_detailsContainer = new DetailsWidget(this);
|
|
|
|
|
m_detailsContainer->setState(DetailsWidget::NoSummary);
|
2009-10-01 14:24:44 +02:00
|
|
|
vboxTopLayout->addWidget(m_detailsContainer);
|
|
|
|
|
QWidget *detailsWidget = new QWidget(m_detailsContainer);
|
|
|
|
|
m_detailsContainer->setWidget(detailsWidget);
|
|
|
|
|
QFormLayout *toplayout = new QFormLayout(detailsWidget);
|
2009-07-22 17:02:12 +02:00
|
|
|
toplayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
2008-12-02 12:01:29 +01:00
|
|
|
toplayout->setMargin(0);
|
|
|
|
|
|
2015-01-23 12:05:14 +01:00
|
|
|
m_executableLineLabel = new QLabel(m_qmakeRunConfiguration->executable(), this);
|
|
|
|
|
m_executableLineLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
|
|
|
|
|
toplayout->addRow(tr("Executable:"), m_executableLineLabel);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-04-30 14:52:41 +02:00
|
|
|
m_qmakeRunConfiguration->extraAspect<ArgumentsAspect>()->addToMainConfigurationWidget(this, toplayout);
|
2015-12-18 14:57:23 +01:00
|
|
|
m_qmakeRunConfiguration->extraAspect<WorkingDirectoryAspect>()->addToMainConfigurationWidget(this, toplayout);
|
2015-05-18 16:18:49 +02:00
|
|
|
m_qmakeRunConfiguration->extraAspect<TerminalAspect>()->addToMainConfigurationWidget(this, toplayout);
|
2013-02-21 17:36:55 +01:00
|
|
|
|
|
|
|
|
m_useQvfbCheck = new QCheckBox(tr("Run on QVFb"), this);
|
|
|
|
|
m_useQvfbCheck->setToolTip(tr("Check this option to run the application on a Qt Virtual Framebuffer."));
|
2014-05-26 23:42:25 +03:00
|
|
|
m_useQvfbCheck->setChecked(m_qmakeRunConfiguration->runMode() == ApplicationLauncher::Console);
|
2013-02-21 17:36:55 +01:00
|
|
|
m_useQvfbCheck->setVisible(false);
|
2015-05-18 16:18:49 +02:00
|
|
|
QHBoxLayout *innerBox = new QHBoxLayout();
|
2013-02-21 17:36:55 +01:00
|
|
|
innerBox->addWidget(m_useQvfbCheck);
|
|
|
|
|
innerBox->addStretch();
|
|
|
|
|
toplayout->addRow(QString(), innerBox);
|
2009-02-18 17:04:04 +01:00
|
|
|
|
2013-10-29 17:48:43 +01:00
|
|
|
if (HostOsInfo::isMacHost()) {
|
2012-08-23 15:53:58 +02:00
|
|
|
m_usingDyldImageSuffix = new QCheckBox(tr("Use debug version of frameworks (DYLD_IMAGE_SUFFIX=_debug)"), this);
|
2013-10-29 15:15:10 +01:00
|
|
|
m_usingDyldImageSuffix->setChecked(m_qmakeRunConfiguration->isUsingDyldImageSuffix());
|
2012-08-23 15:53:58 +02:00
|
|
|
toplayout->addRow(QString(), m_usingDyldImageSuffix);
|
|
|
|
|
connect(m_usingDyldImageSuffix, SIGNAL(toggled(bool)),
|
|
|
|
|
this, SLOT(usingDyldImageSuffixToggled(bool)));
|
|
|
|
|
}
|
2009-03-26 12:01:08 +01:00
|
|
|
|
2015-09-02 17:11:31 +02:00
|
|
|
QString librarySeachPathLabel;
|
|
|
|
|
if (HostOsInfo::isMacHost()) {
|
|
|
|
|
librarySeachPathLabel
|
|
|
|
|
= tr("Add build library search path to DYLD_LIBRARY_PATH and DYLD_FRAMEWORK_PATH");
|
|
|
|
|
} else if (HostOsInfo::isWindowsHost()) {
|
|
|
|
|
librarySeachPathLabel
|
|
|
|
|
= tr("Add build library search path to PATH");
|
|
|
|
|
} else if (HostOsInfo::isLinuxHost() || HostOsInfo::isAnyUnixHost()) {
|
|
|
|
|
librarySeachPathLabel
|
|
|
|
|
= tr("Add build library search path to LD_LIBRARY_PATH");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!librarySeachPathLabel.isEmpty()) {
|
|
|
|
|
m_usingLibrarySearchPath = new QCheckBox(librarySeachPathLabel);
|
|
|
|
|
m_usingLibrarySearchPath->setChecked(m_qmakeRunConfiguration->isUsingLibrarySearchPath());
|
|
|
|
|
toplayout->addRow(QString(), m_usingLibrarySearchPath);
|
|
|
|
|
connect(m_usingLibrarySearchPath, &QCheckBox::toggled,
|
|
|
|
|
this, &DesktopQmakeRunConfigurationWidget::usingLibrarySearchPathToggled);
|
|
|
|
|
}
|
|
|
|
|
|
2012-03-29 13:11:00 +02:00
|
|
|
runConfigurationEnabledChange();
|
2010-10-27 16:27:22 +02:00
|
|
|
|
2013-02-21 17:36:55 +01:00
|
|
|
connect(m_useQvfbCheck, SIGNAL(toggled(bool)),
|
|
|
|
|
this, SLOT(qvfbToggled(bool)));
|
2009-02-18 17:04:04 +01:00
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
connect(qmakeRunConfiguration, SIGNAL(usingDyldImageSuffixChanged(bool)),
|
2009-03-26 12:01:08 +01:00
|
|
|
this, SLOT(usingDyldImageSuffixChanged(bool)));
|
2015-09-02 17:11:31 +02:00
|
|
|
connect(qmakeRunConfiguration, &DesktopQmakeRunConfiguration::usingLibrarySearchPathChanged,
|
|
|
|
|
this, &DesktopQmakeRunConfigurationWidget::usingLibrarySearchPathChanged);
|
2013-10-29 15:15:10 +01:00
|
|
|
connect(qmakeRunConfiguration, SIGNAL(effectiveTargetInformationChanged()),
|
2009-03-19 15:04:43 +01:00
|
|
|
this, SLOT(effectiveTargetInformationChanged()), Qt::QueuedConnection);
|
2009-05-27 13:37:21 +02:00
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
connect(qmakeRunConfiguration, SIGNAL(enabledChanged()),
|
2012-03-29 13:11:00 +02:00
|
|
|
this, SLOT(runConfigurationEnabledChange()));
|
2014-11-05 16:23:34 +01:00
|
|
|
|
|
|
|
|
Core::VariableChooser::addSupportForChildWidgets(this, m_qmakeRunConfiguration->macroExpander());
|
2009-05-27 14:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
DesktopQmakeRunConfigurationWidget::~DesktopQmakeRunConfigurationWidget()
|
2010-02-23 14:33:41 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
void DesktopQmakeRunConfigurationWidget::runConfigurationEnabledChange()
|
2010-10-27 16:27:22 +02:00
|
|
|
{
|
2013-10-29 15:15:10 +01:00
|
|
|
bool enabled = m_qmakeRunConfiguration->isEnabled();
|
2011-06-10 15:37:10 +02:00
|
|
|
m_disabledIcon->setVisible(!enabled);
|
|
|
|
|
m_disabledReason->setVisible(!enabled);
|
2013-10-29 15:15:10 +01:00
|
|
|
m_disabledReason->setText(m_qmakeRunConfiguration->disabledReason());
|
2010-10-27 16:27:22 +02:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
void DesktopQmakeRunConfigurationWidget::qvfbToggled(bool on)
|
2013-02-21 17:36:55 +01:00
|
|
|
{
|
2013-02-28 13:11:45 +01:00
|
|
|
Q_UNUSED(on);
|
2013-02-21 17:36:55 +01:00
|
|
|
m_ignoreChange = true;
|
|
|
|
|
m_ignoreChange = false;
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
void DesktopQmakeRunConfigurationWidget::usingDyldImageSuffixToggled(bool state)
|
2009-03-26 12:01:08 +01:00
|
|
|
{
|
|
|
|
|
m_ignoreChange = true;
|
2013-10-29 15:15:10 +01:00
|
|
|
m_qmakeRunConfiguration->setUsingDyldImageSuffix(state);
|
2009-03-26 12:01:08 +01:00
|
|
|
m_ignoreChange = false;
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-02 17:11:31 +02:00
|
|
|
void DesktopQmakeRunConfigurationWidget::usingLibrarySearchPathToggled(bool state)
|
|
|
|
|
{
|
|
|
|
|
m_ignoreChange = true;
|
|
|
|
|
m_qmakeRunConfiguration->setUsingLibrarySearchPath(state);
|
|
|
|
|
m_ignoreChange = false;
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
void DesktopQmakeRunConfigurationWidget::usingDyldImageSuffixChanged(bool state)
|
2009-03-26 12:01:08 +01:00
|
|
|
{
|
|
|
|
|
if (!m_ignoreChange && m_usingDyldImageSuffix)
|
|
|
|
|
m_usingDyldImageSuffix->setChecked(state);
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-02 17:11:31 +02:00
|
|
|
void DesktopQmakeRunConfigurationWidget::usingLibrarySearchPathChanged(bool state)
|
|
|
|
|
{
|
|
|
|
|
if (!m_ignoreChange && m_usingLibrarySearchPath)
|
|
|
|
|
m_usingLibrarySearchPath->setChecked(state);
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
void DesktopQmakeRunConfigurationWidget::effectiveTargetInformationChanged()
|
2009-01-27 18:23:02 +01:00
|
|
|
{
|
2015-12-18 14:57:23 +01:00
|
|
|
m_executableLineLabel->setText(QDir::toNativeSeparators(m_qmakeRunConfiguration->executable()));
|
2009-01-27 18:23:02 +01:00
|
|
|
|
2015-12-18 14:57:23 +01:00
|
|
|
m_ignoreChange = true;
|
|
|
|
|
auto aspect = m_qmakeRunConfiguration->extraAspect<WorkingDirectoryAspect>();
|
|
|
|
|
aspect->setDefaultWorkingDirectory(m_qmakeRunConfiguration->baseWorkingDirectory());
|
|
|
|
|
aspect->pathChooser()->setBaseFileName(m_qmakeRunConfiguration->target()->project()->projectDirectory());
|
|
|
|
|
m_ignoreChange = false;
|
2009-03-19 15:04:43 +01:00
|
|
|
}
|
2009-01-27 18:23:02 +01:00
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
QWidget *DesktopQmakeRunConfiguration::createConfigurationWidget()
|
2009-01-27 18:23:02 +01:00
|
|
|
{
|
2013-10-29 18:14:50 +01:00
|
|
|
return new DesktopQmakeRunConfigurationWidget(this, 0);
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
QVariantMap DesktopQmakeRunConfiguration::toMap() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2014-05-02 12:53:36 +02:00
|
|
|
const QDir projectDir = QDir(target()->project()->projectDirectory().toString());
|
2010-01-19 13:41:02 +01:00
|
|
|
QVariantMap map(LocalApplicationRunConfiguration::toMap());
|
2015-02-02 00:37:38 +02:00
|
|
|
map.insert(QLatin1String(PRO_FILE_KEY), projectDir.relativeFilePath(m_proFilePath.toString()));
|
2010-01-19 13:41:02 +01:00
|
|
|
map.insert(QLatin1String(USE_DYLD_IMAGE_SUFFIX_KEY), m_isUsingDyldImageSuffix);
|
2015-09-02 17:11:31 +02:00
|
|
|
map.insert(QLatin1String(USE_LIBRARY_SEARCH_PATH), m_isUsingLibrarySearchPath);
|
2010-01-19 13:41:02 +01:00
|
|
|
return map;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
bool DesktopQmakeRunConfiguration::fromMap(const QVariantMap &map)
|
2010-01-29 21:33:57 +01:00
|
|
|
{
|
2014-05-02 12:53:36 +02:00
|
|
|
const QDir projectDir = QDir(target()->project()->projectDirectory().toString());
|
2015-02-02 00:37:38 +02:00
|
|
|
m_proFilePath = Utils::FileName::fromUserInput(projectDir.filePath(map.value(QLatin1String(PRO_FILE_KEY)).toString()));
|
2010-01-19 13:41:02 +01:00
|
|
|
m_isUsingDyldImageSuffix = map.value(QLatin1String(USE_DYLD_IMAGE_SUFFIX_KEY), false).toBool();
|
2015-09-02 17:11:31 +02:00
|
|
|
m_isUsingLibrarySearchPath = map.value(QLatin1String(USE_LIBRARY_SEARCH_PATH), true).toBool();
|
2010-01-19 13:41:02 +01:00
|
|
|
|
2013-10-29 14:22:31 +01:00
|
|
|
m_parseSuccess = static_cast<QmakeProject *>(target()->project())->validParse(m_proFilePath);
|
|
|
|
|
m_parseInProgress = static_cast<QmakeProject *>(target()->project())->parseInProgress(m_proFilePath);
|
2010-11-02 12:26:55 +01:00
|
|
|
|
2013-10-09 16:22:56 +02:00
|
|
|
return LocalApplicationRunConfiguration::fromMap(map);
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
QString DesktopQmakeRunConfiguration::executable() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2013-10-29 14:22:31 +01:00
|
|
|
QmakeProject *pro = static_cast<QmakeProject *>(target()->project());
|
|
|
|
|
const QmakeProFileNode *node = pro->rootQmakeProjectNode()->findProFileFor(m_proFilePath);
|
2013-03-12 14:09:18 +01:00
|
|
|
return extractWorkingDirAndExecutable(node).second;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2014-05-26 23:42:25 +03:00
|
|
|
ApplicationLauncher::Mode DesktopQmakeRunConfiguration::runMode() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2015-05-18 16:18:49 +02:00
|
|
|
return extraAspect<TerminalAspect>()->runMode();
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
bool DesktopQmakeRunConfiguration::isUsingDyldImageSuffix() const
|
2009-03-26 12:01:08 +01:00
|
|
|
{
|
|
|
|
|
return m_isUsingDyldImageSuffix;
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
void DesktopQmakeRunConfiguration::setUsingDyldImageSuffix(bool state)
|
2009-03-26 12:01:08 +01:00
|
|
|
{
|
|
|
|
|
m_isUsingDyldImageSuffix = state;
|
|
|
|
|
emit usingDyldImageSuffixChanged(state);
|
2015-09-02 17:09:00 +02:00
|
|
|
|
|
|
|
|
LocalEnvironmentAspect *aspect = extraAspect<LocalEnvironmentAspect>();
|
|
|
|
|
QTC_ASSERT(aspect, return);
|
|
|
|
|
aspect->environmentChanged();
|
2009-03-26 12:01:08 +01:00
|
|
|
}
|
|
|
|
|
|
2015-09-02 17:11:31 +02:00
|
|
|
bool DesktopQmakeRunConfiguration::isUsingLibrarySearchPath() const
|
|
|
|
|
{
|
|
|
|
|
return m_isUsingLibrarySearchPath;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DesktopQmakeRunConfiguration::setUsingLibrarySearchPath(bool state)
|
|
|
|
|
{
|
|
|
|
|
m_isUsingLibrarySearchPath = state;
|
|
|
|
|
emit usingLibrarySearchPathChanged(state);
|
|
|
|
|
|
|
|
|
|
LocalEnvironmentAspect *aspect = extraAspect<LocalEnvironmentAspect>();
|
|
|
|
|
QTC_ASSERT(aspect, return);
|
|
|
|
|
aspect->environmentChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
QString DesktopQmakeRunConfiguration::workingDirectory() const
|
2010-09-27 15:04:58 +01:00
|
|
|
{
|
2015-12-18 14:57:23 +01:00
|
|
|
return extraAspect<WorkingDirectoryAspect>()->workingDirectory();
|
2010-09-27 15:04:58 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
QString DesktopQmakeRunConfiguration::baseWorkingDirectory() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2013-10-29 14:22:31 +01:00
|
|
|
QmakeProject *pro = static_cast<QmakeProject *>(target()->project());
|
|
|
|
|
const QmakeProFileNode *node = pro->rootQmakeProjectNode()->findProFileFor(m_proFilePath);
|
2013-03-12 14:09:18 +01:00
|
|
|
return extractWorkingDirAndExecutable(node).first;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
QString DesktopQmakeRunConfiguration::commandLineArguments() const
|
2010-11-12 17:23:55 +01:00
|
|
|
{
|
2015-04-30 14:52:41 +02:00
|
|
|
return extraAspect<ArgumentsAspect>()->arguments();
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
void DesktopQmakeRunConfiguration::addToBaseEnvironment(Environment &env) const
|
2013-01-29 17:04:19 +01:00
|
|
|
{
|
|
|
|
|
if (m_isUsingDyldImageSuffix)
|
|
|
|
|
env.set(QLatin1String("DYLD_IMAGE_SUFFIX"), QLatin1String("_debug"));
|
|
|
|
|
|
|
|
|
|
// The user could be linking to a library found via a -L/some/dir switch
|
|
|
|
|
// to find those libraries while actually running we explicitly prepend those
|
|
|
|
|
// dirs to the library search path
|
2013-10-29 14:22:31 +01:00
|
|
|
const QmakeProFileNode *node = static_cast<QmakeProject *>(target()->project())->rootQmakeProjectNode()->findProFileFor(m_proFilePath);
|
2015-09-02 17:11:31 +02:00
|
|
|
if (m_isUsingLibrarySearchPath && node) {
|
2013-01-29 17:04:19 +01:00
|
|
|
const QStringList libDirectories = node->variableValue(LibDirectoriesVar);
|
|
|
|
|
if (!libDirectories.isEmpty()) {
|
|
|
|
|
const QString proDirectory = node->buildDir();
|
|
|
|
|
foreach (QString dir, libDirectories) {
|
|
|
|
|
// Fix up relative entries like "LIBS+=-L.."
|
|
|
|
|
const QFileInfo fi(dir);
|
|
|
|
|
if (!fi.isAbsolute())
|
|
|
|
|
dir = QDir::cleanPath(proDirectory + QLatin1Char('/') + dir);
|
|
|
|
|
env.prependOrSetLibrarySearchPath(dir);
|
|
|
|
|
} // foreach
|
|
|
|
|
} // libDirectories
|
|
|
|
|
} // node
|
|
|
|
|
|
|
|
|
|
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(target()->kit());
|
2015-09-02 17:11:31 +02:00
|
|
|
if (qtVersion && m_isUsingLibrarySearchPath)
|
2013-01-29 17:04:19 +01:00
|
|
|
env.prependOrSetLibrarySearchPath(qtVersion->qmakeProperty("QT_INSTALL_LIBS"));
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-02 00:37:38 +02:00
|
|
|
Utils::FileName DesktopQmakeRunConfiguration::proFilePath() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
return m_proFilePath;
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
QString DesktopQmakeRunConfiguration::defaultDisplayName()
|
2010-01-19 13:41:02 +01:00
|
|
|
{
|
2015-08-12 11:16:36 +02:00
|
|
|
auto project = static_cast<QmakeProject *>(target()->project());
|
|
|
|
|
const QmakeProFileNode *root = project->rootQmakeProjectNode();
|
|
|
|
|
if (root) {
|
|
|
|
|
const QmakeProFileNode *node = root->findProFileFor(m_proFilePath);
|
|
|
|
|
if (node) // should always be found
|
|
|
|
|
return node->displayName();
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-18 15:42:01 +02:00
|
|
|
QString defaultName;
|
2010-01-19 13:41:02 +01:00
|
|
|
if (!m_proFilePath.isEmpty())
|
2015-02-02 00:37:38 +02:00
|
|
|
defaultName = m_proFilePath.toFileInfo().completeBaseName();
|
2010-01-19 13:41:02 +01:00
|
|
|
else
|
2012-11-06 13:45:14 +01:00
|
|
|
defaultName = tr("Qt Run Configuration");
|
2010-08-18 15:42:01 +02:00
|
|
|
return defaultName;
|
2010-01-19 13:41:02 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
OutputFormatter *DesktopQmakeRunConfiguration::createOutputFormatter() const
|
2010-07-13 15:02:37 +02:00
|
|
|
{
|
2012-04-24 15:49:09 +02:00
|
|
|
return new QtSupport::QtOutputFormatter(target()->project());
|
2010-07-13 15:02:37 +02:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
QPair<QString, QString> DesktopQmakeRunConfiguration::extractWorkingDirAndExecutable(const QmakeProFileNode *node) const
|
2013-03-12 14:09:18 +01:00
|
|
|
{
|
|
|
|
|
if (!node)
|
|
|
|
|
return qMakePair(QString(), QString());
|
|
|
|
|
TargetInformation ti = node->targetInformation();
|
|
|
|
|
if (!ti.valid)
|
|
|
|
|
return qMakePair(QString(), QString());
|
|
|
|
|
|
|
|
|
|
const QStringList &config = node->variableValue(ConfigVar);
|
|
|
|
|
|
|
|
|
|
QString destDir = ti.destDir;
|
|
|
|
|
QString workingDir;
|
|
|
|
|
if (!destDir.isEmpty()) {
|
|
|
|
|
bool workingDirIsBaseDir = false;
|
2013-11-11 22:20:47 +02:00
|
|
|
if (destDir == ti.buildTarget)
|
2013-03-12 14:09:18 +01:00
|
|
|
workingDirIsBaseDir = true;
|
|
|
|
|
if (QDir::isRelativePath(destDir))
|
|
|
|
|
destDir = QDir::cleanPath(ti.buildDir + QLatin1Char('/') + destDir);
|
|
|
|
|
|
|
|
|
|
if (workingDirIsBaseDir)
|
|
|
|
|
workingDir = ti.buildDir;
|
|
|
|
|
else
|
|
|
|
|
workingDir = destDir;
|
|
|
|
|
} else {
|
|
|
|
|
destDir = ti.buildDir;
|
|
|
|
|
workingDir = ti.buildDir;
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 17:48:43 +01:00
|
|
|
if (HostOsInfo::isMacHost() && config.contains(QLatin1String("app_bundle"))) {
|
2013-03-12 14:09:18 +01:00
|
|
|
const QString infix = QLatin1Char('/') + ti.target
|
|
|
|
|
+ QLatin1String(".app/Contents/MacOS");
|
|
|
|
|
workingDir += infix;
|
|
|
|
|
destDir += infix;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString executable = QDir::cleanPath(destDir + QLatin1Char('/') + ti.target);
|
2013-10-29 17:48:43 +01:00
|
|
|
executable = HostOsInfo::withExecutableSuffix(executable);
|
|
|
|
|
//qDebug() << "##### QmakeRunConfiguration::extractWorkingDirAndExecutable:" workingDir << executable;
|
2013-03-12 14:09:18 +01:00
|
|
|
return qMakePair(workingDir, executable);
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
///
|
2013-10-29 18:14:50 +01:00
|
|
|
/// DesktopQmakeRunConfigurationFactory
|
2008-12-02 12:01:29 +01:00
|
|
|
/// This class is used to restore run settings (saved in .user files)
|
|
|
|
|
///
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
DesktopQmakeRunConfigurationFactory::DesktopQmakeRunConfigurationFactory(QObject *parent) :
|
2012-04-24 15:49:09 +02:00
|
|
|
QmakeRunConfigurationFactory(parent)
|
2013-10-29 18:14:50 +01:00
|
|
|
{ setObjectName(QLatin1String("DesktopQmakeRunConfigurationFactory")); }
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
DesktopQmakeRunConfigurationFactory::~DesktopQmakeRunConfigurationFactory()
|
2012-04-24 15:49:09 +02:00
|
|
|
{ }
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2014-07-01 11:08:26 +02:00
|
|
|
bool DesktopQmakeRunConfigurationFactory::canCreate(Target *parent, Core::Id id) const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2012-04-24 15:49:09 +02:00
|
|
|
if (!canHandle(parent))
|
2010-02-08 15:50:06 +01:00
|
|
|
return false;
|
2013-10-29 14:22:31 +01:00
|
|
|
QmakeProject *project = static_cast<QmakeProject *>(parent->project());
|
2012-04-24 15:49:09 +02:00
|
|
|
return project->hasApplicationProFile(pathFromId(id));
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2014-07-01 11:08:26 +02:00
|
|
|
RunConfiguration *DesktopQmakeRunConfigurationFactory::doCreate(Target *parent, Core::Id id)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2013-10-29 18:14:50 +01:00
|
|
|
DesktopQmakeRunConfiguration *rc = new DesktopQmakeRunConfiguration(parent, id);
|
2012-04-24 15:49:09 +02:00
|
|
|
return rc;
|
2010-01-19 13:41:02 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
bool DesktopQmakeRunConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const
|
2010-01-19 13:41:02 +01:00
|
|
|
{
|
2012-04-24 15:49:09 +02:00
|
|
|
if (!canHandle(parent))
|
2010-01-19 13:41:02 +01:00
|
|
|
return false;
|
2013-10-29 17:48:43 +01:00
|
|
|
return idFromMap(map).toString().startsWith(QLatin1String(QMAKE_RC_PREFIX));
|
2010-01-19 13:41:02 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
RunConfiguration *DesktopQmakeRunConfigurationFactory::doRestore(Target *parent, const QVariantMap &map)
|
2010-01-19 13:41:02 +01:00
|
|
|
{
|
2013-10-29 18:14:50 +01:00
|
|
|
return new DesktopQmakeRunConfiguration(parent, idFromMap(map));
|
2010-01-19 13:41:02 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
bool DesktopQmakeRunConfigurationFactory::canClone(Target *parent, RunConfiguration *source) const
|
2010-01-19 13:41:02 +01:00
|
|
|
{
|
2010-02-08 15:50:06 +01:00
|
|
|
return canCreate(parent, source->id());
|
2010-01-19 13:41:02 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
RunConfiguration *DesktopQmakeRunConfigurationFactory::clone(Target *parent, RunConfiguration *source)
|
2010-01-19 13:41:02 +01:00
|
|
|
{
|
|
|
|
|
if (!canClone(parent, source))
|
|
|
|
|
return 0;
|
2013-10-29 18:14:50 +01:00
|
|
|
DesktopQmakeRunConfiguration *old = static_cast<DesktopQmakeRunConfiguration *>(source);
|
|
|
|
|
return new DesktopQmakeRunConfiguration(parent, old);
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2014-06-12 16:24:52 +02:00
|
|
|
QList<Core::Id> DesktopQmakeRunConfigurationFactory::availableCreationIds(Target *parent, CreationMode mode) const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2012-04-24 15:49:09 +02:00
|
|
|
if (!canHandle(parent))
|
2014-06-12 16:24:52 +02:00
|
|
|
return QList<Core::Id>();
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2013-10-29 14:22:31 +01:00
|
|
|
QmakeProject *project = static_cast<QmakeProject *>(parent->project());
|
2014-06-04 13:11:25 +02:00
|
|
|
QList<QmakeProFileNode *> nodes = project->applicationProFiles();
|
2014-06-12 16:24:52 +02:00
|
|
|
if (mode == AutoCreate)
|
|
|
|
|
nodes = QmakeProject::nodesWithQtcRunnable(nodes);
|
2014-06-04 13:11:25 +02:00
|
|
|
return QmakeProject::idsForNodes(Core::Id(QMAKE_RC_PREFIX), nodes);
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2014-07-01 11:08:26 +02:00
|
|
|
QString DesktopQmakeRunConfigurationFactory::displayNameForId(Core::Id id) const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2015-02-02 00:37:38 +02:00
|
|
|
return pathFromId(id).toFileInfo().completeBaseName();
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2013-10-29 18:14:50 +01:00
|
|
|
bool DesktopQmakeRunConfigurationFactory::canHandle(Target *t) const
|
2012-04-24 15:49:09 +02:00
|
|
|
{
|
2012-09-03 18:31:44 +02:00
|
|
|
if (!t->project()->supportsKit(t->kit()))
|
2012-04-24 15:49:09 +02:00
|
|
|
return false;
|
2013-10-29 14:22:31 +01:00
|
|
|
if (!qobject_cast<QmakeProject *>(t->project()))
|
2012-04-24 15:49:09 +02:00
|
|
|
return false;
|
2013-10-29 17:48:43 +01:00
|
|
|
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(t->kit());
|
|
|
|
|
return devType == Constants::DESKTOP_DEVICE_TYPE;
|
2012-04-24 15:49:09 +02:00
|
|
|
}
|
|
|
|
|
|
2014-04-29 08:35:00 +02:00
|
|
|
QList<RunConfiguration *> DesktopQmakeRunConfigurationFactory::runConfigurationsForNode(Target *t, const Node *n)
|
2012-04-24 15:49:09 +02:00
|
|
|
{
|
2013-10-29 17:48:43 +01:00
|
|
|
QList<RunConfiguration *> result;
|
|
|
|
|
foreach (RunConfiguration *rc, t->runConfigurations())
|
2013-10-29 18:14:50 +01:00
|
|
|
if (DesktopQmakeRunConfiguration *qt4c = qobject_cast<DesktopQmakeRunConfiguration *>(rc))
|
2015-10-29 17:53:47 +01:00
|
|
|
if (qt4c->proFilePath() == n->filePath())
|
2012-04-24 15:49:09 +02:00
|
|
|
result << rc;
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2013-10-29 17:48:43 +01:00
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace QmakeProjectManager
|