Rename the QmakeRunConfiguration to DesktopQmakeRunConfiguration

Also rename the related factory and config widget.

This was necessary since QmakeRunConfigurationFactory was already
taken by the base class.

Change-Id: I37875935101b7560ad64c8a8c27d821c9810b387
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Tobias Hunger
2013-10-29 18:14:50 +01:00
committed by hjk
parent 52a561c915
commit cc7511cb9b
5 changed files with 91 additions and 91 deletions

View File

@@ -27,7 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
#include "qmakerunconfiguration.h" #include "desktopqmakerunconfiguration.h"
#include "qmakenodes.h" #include "qmakenodes.h"
#include "qmakeproject.h" #include "qmakeproject.h"
@@ -77,7 +77,7 @@ static QString pathFromId(Core::Id id)
// QmakeRunConfiguration // QmakeRunConfiguration
// //
QmakeRunConfiguration::QmakeRunConfiguration(Target *parent, Core::Id id) : DesktopQmakeRunConfiguration::DesktopQmakeRunConfiguration(Target *parent, Core::Id id) :
LocalApplicationRunConfiguration(parent, id), LocalApplicationRunConfiguration(parent, id),
m_proFilePath(pathFromId(id)), m_proFilePath(pathFromId(id)),
m_runMode(Gui), m_runMode(Gui),
@@ -90,7 +90,7 @@ QmakeRunConfiguration::QmakeRunConfiguration(Target *parent, Core::Id id) :
ctor(); ctor();
} }
QmakeRunConfiguration::QmakeRunConfiguration(Target *parent, QmakeRunConfiguration *source) : DesktopQmakeRunConfiguration::DesktopQmakeRunConfiguration(Target *parent, DesktopQmakeRunConfiguration *source) :
LocalApplicationRunConfiguration(parent, source), LocalApplicationRunConfiguration(parent, source),
m_commandLineArguments(source->m_commandLineArguments), m_commandLineArguments(source->m_commandLineArguments),
m_proFilePath(source->m_proFilePath), m_proFilePath(source->m_proFilePath),
@@ -103,16 +103,16 @@ QmakeRunConfiguration::QmakeRunConfiguration(Target *parent, QmakeRunConfigurati
ctor(); ctor();
} }
QmakeRunConfiguration::~QmakeRunConfiguration() DesktopQmakeRunConfiguration::~DesktopQmakeRunConfiguration()
{ {
} }
bool QmakeRunConfiguration::isEnabled() const bool DesktopQmakeRunConfiguration::isEnabled() const
{ {
return m_parseSuccess && !m_parseInProgress; return m_parseSuccess && !m_parseInProgress;
} }
QString QmakeRunConfiguration::disabledReason() const QString DesktopQmakeRunConfiguration::disabledReason() const
{ {
if (m_parseInProgress) if (m_parseInProgress)
return tr("The .pro file '%1' is currently being parsed.") return tr("The .pro file '%1' is currently being parsed.")
@@ -123,7 +123,7 @@ QString QmakeRunConfiguration::disabledReason() const
return QString(); return QString();
} }
void QmakeRunConfiguration::proFileUpdated(QmakeProFileNode *pro, bool success, bool parseInProgress) void DesktopQmakeRunConfiguration::proFileUpdated(QmakeProFileNode *pro, bool success, bool parseInProgress)
{ {
LocalEnvironmentAspect *aspect = extraAspect<LocalEnvironmentAspect>(); LocalEnvironmentAspect *aspect = extraAspect<LocalEnvironmentAspect>();
QTC_ASSERT(aspect, return); QTC_ASSERT(aspect, return);
@@ -150,7 +150,7 @@ void QmakeRunConfiguration::proFileUpdated(QmakeProFileNode *pro, bool success,
} }
} }
void QmakeRunConfiguration::ctor() void DesktopQmakeRunConfiguration::ctor()
{ {
setDefaultDisplayName(defaultDisplayName()); setDefaultDisplayName(defaultDisplayName());
@@ -163,7 +163,7 @@ void QmakeRunConfiguration::ctor()
this, SLOT(kitChanged())); this, SLOT(kitChanged()));
} }
void QmakeRunConfiguration::kitChanged() void DesktopQmakeRunConfiguration::kitChanged()
{ {
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit()); QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
m_forcedGuiMode = (version && version->type() == QLatin1String(QtSupport::Constants::SIMULATORQT)); m_forcedGuiMode = (version && version->type() == QLatin1String(QtSupport::Constants::SIMULATORQT));
@@ -171,10 +171,10 @@ void QmakeRunConfiguration::kitChanged()
} }
////// //////
/// Qt4RunConfigurationWidget /// DesktopQmakeRunConfigurationWidget
///// /////
QmakeRunConfigurationWidget::QmakeRunConfigurationWidget(QmakeRunConfiguration *qmakeRunConfiguration, QWidget *parent) DesktopQmakeRunConfigurationWidget::DesktopQmakeRunConfigurationWidget(DesktopQmakeRunConfiguration *qmakeRunConfiguration, QWidget *parent)
: QWidget(parent), : QWidget(parent),
m_qmakeRunConfiguration(qmakeRunConfiguration), m_qmakeRunConfiguration(qmakeRunConfiguration),
m_ignoreChange(false), m_ignoreChange(false),
@@ -287,18 +287,18 @@ QmakeRunConfigurationWidget::QmakeRunConfigurationWidget(QmakeRunConfiguration *
this, SLOT(runConfigurationEnabledChange())); this, SLOT(runConfigurationEnabledChange()));
} }
QmakeRunConfigurationWidget::~QmakeRunConfigurationWidget() DesktopQmakeRunConfigurationWidget::~DesktopQmakeRunConfigurationWidget()
{ {
} }
void QmakeRunConfigurationWidget::environmentWasChanged() void DesktopQmakeRunConfigurationWidget::environmentWasChanged()
{ {
EnvironmentAspect *aspect = m_qmakeRunConfiguration->extraAspect<EnvironmentAspect>(); EnvironmentAspect *aspect = m_qmakeRunConfiguration->extraAspect<EnvironmentAspect>();
QTC_ASSERT(aspect, return); QTC_ASSERT(aspect, return);
m_workingDirectoryEdit->setEnvironment(aspect->environment()); m_workingDirectoryEdit->setEnvironment(aspect->environment());
} }
void QmakeRunConfigurationWidget::runConfigurationEnabledChange() void DesktopQmakeRunConfigurationWidget::runConfigurationEnabledChange()
{ {
bool enabled = m_qmakeRunConfiguration->isEnabled(); bool enabled = m_qmakeRunConfiguration->isEnabled();
m_disabledIcon->setVisible(!enabled); m_disabledIcon->setVisible(!enabled);
@@ -306,7 +306,7 @@ void QmakeRunConfigurationWidget::runConfigurationEnabledChange()
m_disabledReason->setText(m_qmakeRunConfiguration->disabledReason()); m_disabledReason->setText(m_qmakeRunConfiguration->disabledReason());
} }
void QmakeRunConfigurationWidget::workDirectoryEdited() void DesktopQmakeRunConfigurationWidget::workDirectoryEdited()
{ {
if (m_ignoreChange) if (m_ignoreChange)
return; return;
@@ -315,21 +315,21 @@ void QmakeRunConfigurationWidget::workDirectoryEdited()
m_ignoreChange = false; m_ignoreChange = false;
} }
void QmakeRunConfigurationWidget::workingDirectoryReseted() void DesktopQmakeRunConfigurationWidget::workingDirectoryReseted()
{ {
// This emits a signal connected to workingDirectoryChanged() // This emits a signal connected to workingDirectoryChanged()
// that sets the m_workingDirectoryEdit // that sets the m_workingDirectoryEdit
m_qmakeRunConfiguration->setBaseWorkingDirectory(QString()); m_qmakeRunConfiguration->setBaseWorkingDirectory(QString());
} }
void QmakeRunConfigurationWidget::argumentsEdited(const QString &args) void DesktopQmakeRunConfigurationWidget::argumentsEdited(const QString &args)
{ {
m_ignoreChange = true; m_ignoreChange = true;
m_qmakeRunConfiguration->setCommandLineArguments(args); m_qmakeRunConfiguration->setCommandLineArguments(args);
m_ignoreChange = false; m_ignoreChange = false;
} }
void QmakeRunConfigurationWidget::termToggled(bool on) void DesktopQmakeRunConfigurationWidget::termToggled(bool on)
{ {
m_ignoreChange = true; m_ignoreChange = true;
m_qmakeRunConfiguration->setRunMode(on ? LocalApplicationRunConfiguration::Console m_qmakeRunConfiguration->setRunMode(on ? LocalApplicationRunConfiguration::Console
@@ -337,34 +337,34 @@ void QmakeRunConfigurationWidget::termToggled(bool on)
m_ignoreChange = false; m_ignoreChange = false;
} }
void QmakeRunConfigurationWidget::qvfbToggled(bool on) void DesktopQmakeRunConfigurationWidget::qvfbToggled(bool on)
{ {
Q_UNUSED(on); Q_UNUSED(on);
m_ignoreChange = true; m_ignoreChange = true;
m_ignoreChange = false; m_ignoreChange = false;
} }
void QmakeRunConfigurationWidget::usingDyldImageSuffixToggled(bool state) void DesktopQmakeRunConfigurationWidget::usingDyldImageSuffixToggled(bool state)
{ {
m_ignoreChange = true; m_ignoreChange = true;
m_qmakeRunConfiguration->setUsingDyldImageSuffix(state); m_qmakeRunConfiguration->setUsingDyldImageSuffix(state);
m_ignoreChange = false; m_ignoreChange = false;
} }
void QmakeRunConfigurationWidget::workingDirectoryChanged(const QString &workingDirectory) void DesktopQmakeRunConfigurationWidget::workingDirectoryChanged(const QString &workingDirectory)
{ {
if (!m_ignoreChange) if (!m_ignoreChange)
m_workingDirectoryEdit->setPath(workingDirectory); m_workingDirectoryEdit->setPath(workingDirectory);
} }
void QmakeRunConfigurationWidget::commandLineArgumentsChanged(const QString &args) void DesktopQmakeRunConfigurationWidget::commandLineArgumentsChanged(const QString &args)
{ {
if (m_ignoreChange) if (m_ignoreChange)
return; return;
m_argumentsLineEdit->setText(args); m_argumentsLineEdit->setText(args);
} }
void QmakeRunConfigurationWidget::runModeChanged(LocalApplicationRunConfiguration::RunMode runMode) void DesktopQmakeRunConfigurationWidget::runModeChanged(LocalApplicationRunConfiguration::RunMode runMode)
{ {
if (!m_ignoreChange) { if (!m_ignoreChange) {
m_useTerminalCheck->setVisible(!m_qmakeRunConfiguration->forcedGuiMode()); m_useTerminalCheck->setVisible(!m_qmakeRunConfiguration->forcedGuiMode());
@@ -372,13 +372,13 @@ void QmakeRunConfigurationWidget::runModeChanged(LocalApplicationRunConfiguratio
} }
} }
void QmakeRunConfigurationWidget::usingDyldImageSuffixChanged(bool state) void DesktopQmakeRunConfigurationWidget::usingDyldImageSuffixChanged(bool state)
{ {
if (!m_ignoreChange && m_usingDyldImageSuffix) if (!m_ignoreChange && m_usingDyldImageSuffix)
m_usingDyldImageSuffix->setChecked(state); m_usingDyldImageSuffix->setChecked(state);
} }
void QmakeRunConfigurationWidget::effectiveTargetInformationChanged() void DesktopQmakeRunConfigurationWidget::effectiveTargetInformationChanged()
{ {
if (m_isShown) { if (m_isShown) {
m_executableLineEdit->setText(QDir::toNativeSeparators(m_qmakeRunConfiguration->executable())); m_executableLineEdit->setText(QDir::toNativeSeparators(m_qmakeRunConfiguration->executable()));
@@ -388,25 +388,25 @@ void QmakeRunConfigurationWidget::effectiveTargetInformationChanged()
} }
} }
void QmakeRunConfigurationWidget::showEvent(QShowEvent *event) void DesktopQmakeRunConfigurationWidget::showEvent(QShowEvent *event)
{ {
m_isShown = true; m_isShown = true;
effectiveTargetInformationChanged(); effectiveTargetInformationChanged();
QWidget::showEvent(event); QWidget::showEvent(event);
} }
void QmakeRunConfigurationWidget::hideEvent(QHideEvent *event) void DesktopQmakeRunConfigurationWidget::hideEvent(QHideEvent *event)
{ {
m_isShown = false; m_isShown = false;
QWidget::hideEvent(event); QWidget::hideEvent(event);
} }
QWidget *QmakeRunConfiguration::createConfigurationWidget() QWidget *DesktopQmakeRunConfiguration::createConfigurationWidget()
{ {
return new QmakeRunConfigurationWidget(this, 0); return new DesktopQmakeRunConfigurationWidget(this, 0);
} }
QVariantMap QmakeRunConfiguration::toMap() const QVariantMap DesktopQmakeRunConfiguration::toMap() const
{ {
const QDir projectDir = QDir(target()->project()->projectDirectory()); const QDir projectDir = QDir(target()->project()->projectDirectory());
QVariantMap map(LocalApplicationRunConfiguration::toMap()); QVariantMap map(LocalApplicationRunConfiguration::toMap());
@@ -418,7 +418,7 @@ QVariantMap QmakeRunConfiguration::toMap() const
return map; return map;
} }
bool QmakeRunConfiguration::fromMap(const QVariantMap &map) bool DesktopQmakeRunConfiguration::fromMap(const QVariantMap &map)
{ {
const QDir projectDir = QDir(target()->project()->projectDirectory()); const QDir projectDir = QDir(target()->project()->projectDirectory());
m_commandLineArguments = map.value(QLatin1String(COMMAND_LINE_ARGUMENTS_KEY)).toString(); m_commandLineArguments = map.value(QLatin1String(COMMAND_LINE_ARGUMENTS_KEY)).toString();
@@ -434,37 +434,37 @@ bool QmakeRunConfiguration::fromMap(const QVariantMap &map)
return LocalApplicationRunConfiguration::fromMap(map); return LocalApplicationRunConfiguration::fromMap(map);
} }
QString QmakeRunConfiguration::executable() const QString DesktopQmakeRunConfiguration::executable() const
{ {
QmakeProject *pro = static_cast<QmakeProject *>(target()->project()); QmakeProject *pro = static_cast<QmakeProject *>(target()->project());
const QmakeProFileNode *node = pro->rootQmakeProjectNode()->findProFileFor(m_proFilePath); const QmakeProFileNode *node = pro->rootQmakeProjectNode()->findProFileFor(m_proFilePath);
return extractWorkingDirAndExecutable(node).second; return extractWorkingDirAndExecutable(node).second;
} }
LocalApplicationRunConfiguration::RunMode QmakeRunConfiguration::runMode() const LocalApplicationRunConfiguration::RunMode DesktopQmakeRunConfiguration::runMode() const
{ {
if (m_forcedGuiMode) if (m_forcedGuiMode)
return LocalApplicationRunConfiguration::Gui; return LocalApplicationRunConfiguration::Gui;
return m_runMode; return m_runMode;
} }
bool QmakeRunConfiguration::forcedGuiMode() const bool DesktopQmakeRunConfiguration::forcedGuiMode() const
{ {
return m_forcedGuiMode; return m_forcedGuiMode;
} }
bool QmakeRunConfiguration::isUsingDyldImageSuffix() const bool DesktopQmakeRunConfiguration::isUsingDyldImageSuffix() const
{ {
return m_isUsingDyldImageSuffix; return m_isUsingDyldImageSuffix;
} }
void QmakeRunConfiguration::setUsingDyldImageSuffix(bool state) void DesktopQmakeRunConfiguration::setUsingDyldImageSuffix(bool state)
{ {
m_isUsingDyldImageSuffix = state; m_isUsingDyldImageSuffix = state;
emit usingDyldImageSuffixChanged(state); emit usingDyldImageSuffixChanged(state);
} }
QString QmakeRunConfiguration::workingDirectory() const QString DesktopQmakeRunConfiguration::workingDirectory() const
{ {
EnvironmentAspect *aspect = extraAspect<EnvironmentAspect>(); EnvironmentAspect *aspect = extraAspect<EnvironmentAspect>();
QTC_ASSERT(aspect, baseWorkingDirectory()); QTC_ASSERT(aspect, baseWorkingDirectory());
@@ -472,7 +472,7 @@ QString QmakeRunConfiguration::workingDirectory() const
Utils::expandMacros(baseWorkingDirectory(), macroExpander()))); Utils::expandMacros(baseWorkingDirectory(), macroExpander())));
} }
QString QmakeRunConfiguration::baseWorkingDirectory() const QString DesktopQmakeRunConfiguration::baseWorkingDirectory() const
{ {
// if the user overrode us, then return his working directory // if the user overrode us, then return his working directory
if (!m_userWorkingDirectory.isEmpty()) if (!m_userWorkingDirectory.isEmpty())
@@ -484,17 +484,17 @@ QString QmakeRunConfiguration::baseWorkingDirectory() const
return extractWorkingDirAndExecutable(node).first; return extractWorkingDirAndExecutable(node).first;
} }
QString QmakeRunConfiguration::commandLineArguments() const QString DesktopQmakeRunConfiguration::commandLineArguments() const
{ {
return QtcProcess::expandMacros(m_commandLineArguments, macroExpander()); return QtcProcess::expandMacros(m_commandLineArguments, macroExpander());
} }
QString QmakeRunConfiguration::rawCommandLineArguments() const QString DesktopQmakeRunConfiguration::rawCommandLineArguments() const
{ {
return m_commandLineArguments; return m_commandLineArguments;
} }
void QmakeRunConfiguration::setBaseWorkingDirectory(const QString &wd) void DesktopQmakeRunConfiguration::setBaseWorkingDirectory(const QString &wd)
{ {
const QString &oldWorkingDirectory = workingDirectory(); const QString &oldWorkingDirectory = workingDirectory();
@@ -505,19 +505,19 @@ void QmakeRunConfiguration::setBaseWorkingDirectory(const QString &wd)
emit baseWorkingDirectoryChanged(newWorkingDirectory); emit baseWorkingDirectoryChanged(newWorkingDirectory);
} }
void QmakeRunConfiguration::setCommandLineArguments(const QString &argumentsString) void DesktopQmakeRunConfiguration::setCommandLineArguments(const QString &argumentsString)
{ {
m_commandLineArguments = argumentsString; m_commandLineArguments = argumentsString;
emit commandLineArgumentsChanged(argumentsString); emit commandLineArgumentsChanged(argumentsString);
} }
void QmakeRunConfiguration::setRunMode(RunMode runMode) void DesktopQmakeRunConfiguration::setRunMode(RunMode runMode)
{ {
m_runMode = runMode; m_runMode = runMode;
emit runModeChanged(runMode); emit runModeChanged(runMode);
} }
void QmakeRunConfiguration::addToBaseEnvironment(Environment &env) const void DesktopQmakeRunConfiguration::addToBaseEnvironment(Environment &env) const
{ {
if (m_isUsingDyldImageSuffix) if (m_isUsingDyldImageSuffix)
env.set(QLatin1String("DYLD_IMAGE_SUFFIX"), QLatin1String("_debug")); env.set(QLatin1String("DYLD_IMAGE_SUFFIX"), QLatin1String("_debug"));
@@ -545,22 +545,22 @@ void QmakeRunConfiguration::addToBaseEnvironment(Environment &env) const
env.prependOrSetLibrarySearchPath(qtVersion->qmakeProperty("QT_INSTALL_LIBS")); env.prependOrSetLibrarySearchPath(qtVersion->qmakeProperty("QT_INSTALL_LIBS"));
} }
QString QmakeRunConfiguration::proFilePath() const QString DesktopQmakeRunConfiguration::proFilePath() const
{ {
return m_proFilePath; return m_proFilePath;
} }
QString QmakeRunConfiguration::dumperLibrary() const QString DesktopQmakeRunConfiguration::dumperLibrary() const
{ {
return QtSupport::QtKitInformation::dumperLibrary(target()->kit()); return QtSupport::QtKitInformation::dumperLibrary(target()->kit());
} }
QStringList QmakeRunConfiguration::dumperLibraryLocations() const QStringList DesktopQmakeRunConfiguration::dumperLibraryLocations() const
{ {
return QtSupport::QtKitInformation::dumperLibraryLocations(target()->kit()); return QtSupport::QtKitInformation::dumperLibraryLocations(target()->kit());
} }
QString QmakeRunConfiguration::defaultDisplayName() QString DesktopQmakeRunConfiguration::defaultDisplayName()
{ {
QString defaultName; QString defaultName;
if (!m_proFilePath.isEmpty()) if (!m_proFilePath.isEmpty())
@@ -570,12 +570,12 @@ QString QmakeRunConfiguration::defaultDisplayName()
return defaultName; return defaultName;
} }
OutputFormatter *QmakeRunConfiguration::createOutputFormatter() const OutputFormatter *DesktopQmakeRunConfiguration::createOutputFormatter() const
{ {
return new QtSupport::QtOutputFormatter(target()->project()); return new QtSupport::QtOutputFormatter(target()->project());
} }
QPair<QString, QString> QmakeRunConfiguration::extractWorkingDirAndExecutable(const QmakeProFileNode *node) const QPair<QString, QString> DesktopQmakeRunConfiguration::extractWorkingDirAndExecutable(const QmakeProFileNode *node) const
{ {
if (!node) if (!node)
return qMakePair(QString(), QString()); return qMakePair(QString(), QString());
@@ -618,18 +618,18 @@ QPair<QString, QString> QmakeRunConfiguration::extractWorkingDirAndExecutable(co
} }
/// ///
/// Qt4RunConfigurationFactory /// DesktopQmakeRunConfigurationFactory
/// This class is used to restore run settings (saved in .user files) /// This class is used to restore run settings (saved in .user files)
/// ///
Qt4RunConfigurationFactory::Qt4RunConfigurationFactory(QObject *parent) : DesktopQmakeRunConfigurationFactory::DesktopQmakeRunConfigurationFactory(QObject *parent) :
QmakeRunConfigurationFactory(parent) QmakeRunConfigurationFactory(parent)
{ setObjectName(QLatin1String("Qt4RunConfigurationFactory")); } { setObjectName(QLatin1String("DesktopQmakeRunConfigurationFactory")); }
Qt4RunConfigurationFactory::~Qt4RunConfigurationFactory() DesktopQmakeRunConfigurationFactory::~DesktopQmakeRunConfigurationFactory()
{ } { }
bool Qt4RunConfigurationFactory::canCreate(Target *parent, const Core::Id id) const bool DesktopQmakeRunConfigurationFactory::canCreate(Target *parent, const Core::Id id) const
{ {
if (!canHandle(parent)) if (!canHandle(parent))
return false; return false;
@@ -637,9 +637,9 @@ bool Qt4RunConfigurationFactory::canCreate(Target *parent, const Core::Id id) co
return project->hasApplicationProFile(pathFromId(id)); return project->hasApplicationProFile(pathFromId(id));
} }
RunConfiguration *Qt4RunConfigurationFactory::doCreate(Target *parent, const Core::Id id) RunConfiguration *DesktopQmakeRunConfigurationFactory::doCreate(Target *parent, const Core::Id id)
{ {
QmakeRunConfiguration *rc = new QmakeRunConfiguration(parent, id); DesktopQmakeRunConfiguration *rc = new DesktopQmakeRunConfiguration(parent, id);
const QmakeProFileNode *node = static_cast<QmakeProject *>(parent->project())->rootQmakeProjectNode()->findProFileFor(rc->proFilePath()); const QmakeProFileNode *node = static_cast<QmakeProject *>(parent->project())->rootQmakeProjectNode()->findProFileFor(rc->proFilePath());
if (node) // should always be found if (node) // should always be found
rc->setRunMode(node->variableValue(ConfigVar).contains(QLatin1String("console")) rc->setRunMode(node->variableValue(ConfigVar).contains(QLatin1String("console"))
@@ -649,32 +649,32 @@ RunConfiguration *Qt4RunConfigurationFactory::doCreate(Target *parent, const Cor
return rc; return rc;
} }
bool Qt4RunConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const bool DesktopQmakeRunConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const
{ {
if (!canHandle(parent)) if (!canHandle(parent))
return false; return false;
return idFromMap(map).toString().startsWith(QLatin1String(QMAKE_RC_PREFIX)); return idFromMap(map).toString().startsWith(QLatin1String(QMAKE_RC_PREFIX));
} }
RunConfiguration *Qt4RunConfigurationFactory::doRestore(Target *parent, const QVariantMap &map) RunConfiguration *DesktopQmakeRunConfigurationFactory::doRestore(Target *parent, const QVariantMap &map)
{ {
return new QmakeRunConfiguration(parent, idFromMap(map)); return new DesktopQmakeRunConfiguration(parent, idFromMap(map));
} }
bool Qt4RunConfigurationFactory::canClone(Target *parent, RunConfiguration *source) const bool DesktopQmakeRunConfigurationFactory::canClone(Target *parent, RunConfiguration *source) const
{ {
return canCreate(parent, source->id()); return canCreate(parent, source->id());
} }
RunConfiguration *Qt4RunConfigurationFactory::clone(Target *parent, RunConfiguration *source) RunConfiguration *DesktopQmakeRunConfigurationFactory::clone(Target *parent, RunConfiguration *source)
{ {
if (!canClone(parent, source)) if (!canClone(parent, source))
return 0; return 0;
QmakeRunConfiguration *old = static_cast<QmakeRunConfiguration *>(source); DesktopQmakeRunConfiguration *old = static_cast<DesktopQmakeRunConfiguration *>(source);
return new QmakeRunConfiguration(parent, old); return new DesktopQmakeRunConfiguration(parent, old);
} }
QList<Core::Id> Qt4RunConfigurationFactory::availableCreationIds(Target *parent) const QList<Core::Id> DesktopQmakeRunConfigurationFactory::availableCreationIds(Target *parent) const
{ {
QList<Core::Id> result; QList<Core::Id> result;
if (!canHandle(parent)) if (!canHandle(parent))
@@ -687,12 +687,12 @@ QList<Core::Id> Qt4RunConfigurationFactory::availableCreationIds(Target *parent)
return result; return result;
} }
QString Qt4RunConfigurationFactory::displayNameForId(const Core::Id id) const QString DesktopQmakeRunConfigurationFactory::displayNameForId(const Core::Id id) const
{ {
return QFileInfo(pathFromId(id)).completeBaseName(); return QFileInfo(pathFromId(id)).completeBaseName();
} }
bool Qt4RunConfigurationFactory::canHandle(Target *t) const bool DesktopQmakeRunConfigurationFactory::canHandle(Target *t) const
{ {
if (!t->project()->supportsKit(t->kit())) if (!t->project()->supportsKit(t->kit()))
return false; return false;
@@ -702,11 +702,11 @@ bool Qt4RunConfigurationFactory::canHandle(Target *t) const
return devType == Constants::DESKTOP_DEVICE_TYPE; return devType == Constants::DESKTOP_DEVICE_TYPE;
} }
QList<RunConfiguration *> Qt4RunConfigurationFactory::runConfigurationsForNode(Target *t, ProjectExplorer::Node *n) QList<RunConfiguration *> DesktopQmakeRunConfigurationFactory::runConfigurationsForNode(Target *t, ProjectExplorer::Node *n)
{ {
QList<RunConfiguration *> result; QList<RunConfiguration *> result;
foreach (RunConfiguration *rc, t->runConfigurations()) foreach (RunConfiguration *rc, t->runConfigurations())
if (QmakeRunConfiguration *qt4c = qobject_cast<QmakeRunConfiguration *>(rc)) if (DesktopQmakeRunConfiguration *qt4c = qobject_cast<DesktopQmakeRunConfiguration *>(rc))
if (qt4c->proFilePath() == n->path()) if (qt4c->proFilePath() == n->path())
result << rc; result << rc;
return result; return result;

View File

@@ -27,8 +27,8 @@
** **
****************************************************************************/ ****************************************************************************/
#ifndef QMAKERUNCONFIGURATION_H #ifndef DESKTOPQMAKERUNCONFIGURATION_H
#define QMAKERUNCONFIGURATION_H #define DESKTOPQMAKERUNCONFIGURATION_H
#include <qmakeprojectmanager/qmakerunconfigurationfactory.h> #include <qmakeprojectmanager/qmakerunconfigurationfactory.h>
@@ -59,18 +59,18 @@ class QmakePriFileNode;
class TargetInformation; class TargetInformation;
namespace Internal { namespace Internal {
class Qt4RunConfigurationFactory; class DesktopQmakeRunConfigurationFactory;
class QmakeRunConfiguration : public ProjectExplorer::LocalApplicationRunConfiguration class DesktopQmakeRunConfiguration : public ProjectExplorer::LocalApplicationRunConfiguration
{ {
Q_OBJECT Q_OBJECT
// to change the display name and arguments and set the userenvironmentchanges // to change the display name and arguments and set the userenvironmentchanges
friend class QmakeRunConfigurationWidget; friend class DesktopQmakeRunConfigurationWidget;
friend class Qt4RunConfigurationFactory; friend class DesktopQmakeRunConfigurationFactory;
public: public:
QmakeRunConfiguration(ProjectExplorer::Target *parent, Core::Id id); DesktopQmakeRunConfiguration(ProjectExplorer::Target *parent, Core::Id id);
virtual ~QmakeRunConfiguration(); virtual ~DesktopQmakeRunConfiguration();
virtual bool isEnabled() const; virtual bool isEnabled() const;
virtual QString disabledReason() const; virtual QString disabledReason() const;
@@ -111,7 +111,7 @@ private slots:
void proFileUpdated(QmakeProjectManager::QmakeProFileNode *pro, bool success, bool parseInProgress); void proFileUpdated(QmakeProjectManager::QmakeProFileNode *pro, bool success, bool parseInProgress);
protected: protected:
QmakeRunConfiguration(ProjectExplorer::Target *parent, QmakeRunConfiguration *source); DesktopQmakeRunConfiguration(ProjectExplorer::Target *parent, DesktopQmakeRunConfiguration *source);
virtual bool fromMap(const QVariantMap &map); virtual bool fromMap(const QVariantMap &map);
private: private:
@@ -138,13 +138,13 @@ private:
bool m_parseInProgress; bool m_parseInProgress;
}; };
class QmakeRunConfigurationWidget : public QWidget class DesktopQmakeRunConfigurationWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
QmakeRunConfigurationWidget(QmakeRunConfiguration *qmakeRunConfiguration, QWidget *parent); DesktopQmakeRunConfigurationWidget(DesktopQmakeRunConfiguration *qmakeRunConfiguration, QWidget *parent);
~QmakeRunConfigurationWidget(); ~DesktopQmakeRunConfigurationWidget();
protected: protected:
void showEvent(QShowEvent *event); void showEvent(QShowEvent *event);
@@ -168,7 +168,7 @@ private slots:
void usingDyldImageSuffixChanged(bool); void usingDyldImageSuffixChanged(bool);
private: private:
QmakeRunConfiguration *m_qmakeRunConfiguration; DesktopQmakeRunConfiguration *m_qmakeRunConfiguration;
bool m_ignoreChange; bool m_ignoreChange;
QLabel *m_disabledIcon; QLabel *m_disabledIcon;
QLabel *m_disabledReason; QLabel *m_disabledReason;
@@ -183,13 +183,13 @@ private:
bool m_isShown; bool m_isShown;
}; };
class Qt4RunConfigurationFactory : public QmakeRunConfigurationFactory class DesktopQmakeRunConfigurationFactory : public QmakeRunConfigurationFactory
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit Qt4RunConfigurationFactory(QObject *parent = 0); explicit DesktopQmakeRunConfigurationFactory(QObject *parent = 0);
~Qt4RunConfigurationFactory(); ~DesktopQmakeRunConfigurationFactory();
bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
@@ -213,4 +213,4 @@ private:
} // namespace Internal } // namespace Internal
} // namespace QmakeProjectManager } // namespace QmakeProjectManager
#endif // QMAKERUNCONFIGURATION_H #endif // DESKTOPQMAKERUNCONFIGURATION_H

View File

@@ -61,7 +61,7 @@ HEADERS += \
librarydetailscontroller.h \ librarydetailscontroller.h \
findqmakeprofiles.h \ findqmakeprofiles.h \
qmakeprojectmanager_global.h \ qmakeprojectmanager_global.h \
qmakerunconfiguration.h \ desktopqmakerunconfiguration.h \
profilecompletionassist.h profilecompletionassist.h
SOURCES += \ SOURCES += \
@@ -118,7 +118,7 @@ SOURCES += \
addlibrarywizard.cpp \ addlibrarywizard.cpp \
librarydetailscontroller.cpp \ librarydetailscontroller.cpp \
findqmakeprofiles.cpp \ findqmakeprofiles.cpp \
qmakerunconfiguration.cpp \ desktopqmakerunconfiguration.cpp \
profilecompletionassist.cpp profilecompletionassist.cpp
FORMS += makestep.ui \ FORMS += makestep.ui \

View File

@@ -22,6 +22,7 @@ QtcPlugin {
name: "General" name: "General"
files: [ files: [
"addlibrarywizard.cpp", "addlibrarywizard.h", "addlibrarywizard.cpp", "addlibrarywizard.h",
"desktopqmakerunconfiguration.cpp", "desktopqmakerunconfiguration.h",
"externaleditors.cpp", "externaleditors.h", "externaleditors.cpp", "externaleditors.h",
"findqmakeprofiles.cpp", "findqmakeprofiles.h", "findqmakeprofiles.cpp", "findqmakeprofiles.h",
"librarydetailscontroller.cpp", "librarydetailscontroller.h", "librarydetailscontroller.cpp", "librarydetailscontroller.h",
@@ -51,7 +52,6 @@ QtcPlugin {
"qmakeprojectmanagerconstants.h", "qmakeprojectmanagerconstants.h",
"qmakeprojectmanagerplugin.cpp", "qmakeprojectmanagerplugin.h", "qmakeprojectmanagerplugin.cpp", "qmakeprojectmanagerplugin.h",
"qtmodulesinfo.cpp", "qtmodulesinfo.h", "qtmodulesinfo.cpp", "qtmodulesinfo.h",
"qmakerunconfiguration.cpp", "qmakerunconfiguration.h",
] ]
} }

View File

@@ -34,7 +34,7 @@
#include "qmakestep.h" #include "qmakestep.h"
#include "makestep.h" #include "makestep.h"
#include "qmakebuildconfiguration.h" #include "qmakebuildconfiguration.h"
#include "qmakerunconfiguration.h" #include "desktopqmakerunconfiguration.h"
#include "wizards/consoleappwizard.h" #include "wizards/consoleappwizard.h"
#include "wizards/guiappwizard.h" #include "wizards/guiappwizard.h"
#include "wizards/librarywizard.h" #include "wizards/librarywizard.h"
@@ -138,7 +138,7 @@ bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString
addAutoReleasedObject(new MakeStepFactory); addAutoReleasedObject(new MakeStepFactory);
addAutoReleasedObject(new QmakeBuildConfigurationFactory); addAutoReleasedObject(new QmakeBuildConfigurationFactory);
addAutoReleasedObject(new Qt4RunConfigurationFactory); addAutoReleasedObject(new DesktopQmakeRunConfigurationFactory);
if (Utils::HostOsInfo::isMacHost()) if (Utils::HostOsInfo::isMacHost())
addAutoReleasedObject(new MacDesignerExternalEditor); addAutoReleasedObject(new MacDesignerExternalEditor);