Commit fc90ea3c authored by dt_'s avatar dt_ Committed by Daniel Teske

Remove BuildConfiguration parameter from RunConfiguration::isEnabled

Noone used it anyway, makes the code easier to refactor later.

Change-Id: I367c3f15ec5034740760dfe1becd3063b2e19dc1
Reviewed-on: http://codereview.qt.nokia.com/187Reviewed-by: default avatarChristian Kandeler <christian.kandeler@nokia.com>
parent f118242a
......@@ -319,9 +319,9 @@ void CMakeRunConfiguration::setEnabled(bool b)
setDefaultDisplayName(defaultDisplayName());
}
bool CMakeRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *bc) const
bool CMakeRunConfiguration::isEnabled() const
{
return m_enabled && LocalApplicationRunConfiguration::isEnabled(bc);
return m_enabled;
}
// Configuration widget
......
......@@ -90,8 +90,7 @@ public:
void setEnabled(bool b);
bool isEnabled(ProjectExplorer::BuildConfiguration *bc) const;
using LocalApplicationRunConfiguration::isEnabled;
bool isEnabled() const;
signals:
void baseEnvironmentChanged();
......
......@@ -2262,7 +2262,6 @@ QString ProjectExplorerPlugin::pathFor(Node *node)
return pathOrDirectoryFor(node, false);
}
QString ProjectExplorerPlugin::directoryFor(Node *node)
{
return pathOrDirectoryFor(node, true);
......
......@@ -198,13 +198,11 @@ void RunConfiguration::addExtraAspects()
}
/*!
\brief Used to find out whether a runconfiguration works with the given buildconfiguration.
\note bc may be 0!
\brief Used to find out whether a runconfiguration is enabled
*/
bool RunConfiguration::isEnabled(BuildConfiguration *bc) const
bool RunConfiguration::isEnabled() const
{
Q_UNUSED(bc);
return true;
}
......@@ -214,18 +212,6 @@ bool RunConfiguration::isEnabled(BuildConfiguration *bc) const
\brief Returns the widget used to configure this run configuration. Ownership is transferred to the caller
*/
/*!
\brief Used to find out whether a runconfiguration works with the active buildconfiguration.
*/
bool RunConfiguration::isEnabled() const
{
if (target()->project()->hasActiveBuildSettings()
&& !activeBuildConfiguration())
return false;
return isEnabled(activeBuildConfiguration());
}
BuildConfiguration *RunConfiguration::activeBuildConfiguration() const
{
if (!target())
......
......@@ -59,8 +59,7 @@ class PROJECTEXPLORER_EXPORT RunConfiguration : public ProjectConfiguration
public:
virtual ~RunConfiguration();
virtual bool isEnabled(BuildConfiguration *bc) const;
bool isEnabled() const;
virtual bool isEnabled() const;
virtual QWidget *createConfigurationWidget() = 0;
Target *target() const;
......
......@@ -86,10 +86,8 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(QmlProjectTarget *parent,
updateQtVersions();
}
bool QmlProjectRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *bc) const
bool QmlProjectRunConfiguration::isEnabled() const
{
Q_UNUSED(bc);
return m_isEnabled;
}
......
......@@ -97,7 +97,7 @@ public:
Utils::Environment environment() const;
// RunConfiguration
bool isEnabled(ProjectExplorer::BuildConfiguration *bc) const;
bool isEnabled() const;
virtual QWidget *createConfigurationWidget();
Utils::OutputFormatter *createOutputFormatter() const;
QVariantMap toMap() const;
......
......@@ -138,11 +138,9 @@ Qt4DesktopTarget *Qt4RunConfiguration::qt4Target() const
return static_cast<Qt4DesktopTarget *>(target());
}
bool Qt4RunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration * /* configuration */) const
bool Qt4RunConfiguration::isEnabled() const
{
if (!m_parseSuccess)
return false;
return true;
return m_parseSuccess;
}
void Qt4RunConfiguration::handleParseState(bool success)
......
......@@ -82,8 +82,7 @@ public:
Qt4DesktopTarget *qt4Target() const;
virtual bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
using ProjectExplorer::LocalApplicationRunConfiguration::isEnabled;
virtual bool isEnabled() const;
virtual QWidget *createConfigurationWidget();
virtual QString executable() const;
......
......@@ -156,16 +156,9 @@ Qt4SymbianTarget *S60DeviceRunConfiguration::qt4Target() const
return static_cast<Qt4SymbianTarget *>(target());
}
bool S60DeviceRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *configuration) const
bool S60DeviceRunConfiguration::isEnabled() const
{
if (!m_validParse)
return false;
Q_ASSERT(configuration->target() == target());
Q_ASSERT(target()->id() == Constants::S60_DEVICE_TARGET_ID);
const Qt4BuildConfiguration *qt4bc = qobject_cast<const Qt4BuildConfiguration *>(configuration);
return qt4bc && qt4bc->toolChain();
return m_validParse;
}
QWidget *S60DeviceRunConfiguration::createConfigurationWidget()
......
......@@ -67,8 +67,7 @@ public:
Qt4SymbianTarget *qt4Target() const;
SymbianQtVersion *qtVersion() const;
using ProjectExplorer::RunConfiguration::isEnabled;
bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
bool isEnabled() const;
QWidget *createConfigurationWidget();
Utils::OutputFormatter *createOutputFormatter() const;
......
......@@ -140,15 +140,9 @@ Qt4SymbianTarget *S60EmulatorRunConfiguration::qt4Target() const
return static_cast<Qt4SymbianTarget *>(target());
}
bool S60EmulatorRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *configuration) const
bool S60EmulatorRunConfiguration::isEnabled() const
{
if (!m_validParse)
return false;
Q_ASSERT(configuration->target() == target());
Q_ASSERT(target()->id() == Constants::S60_EMULATOR_TARGET_ID);
const Qt4BuildConfiguration *qt4bc = qobject_cast<const Qt4BuildConfiguration *>(configuration);
return qt4bc && qt4bc->toolChain();
return m_validParse;
}
QWidget *S60EmulatorRunConfiguration::createConfigurationWidget()
......
......@@ -68,8 +68,7 @@ public:
Qt4SymbianTarget *qt4Target() const;
using ProjectExplorer::RunConfiguration::isEnabled;
bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
bool isEnabled() const;
QWidget *createConfigurationWidget();
Utils::OutputFormatter *createOutputFormatter() const;
......
......@@ -129,11 +129,9 @@ Qt4BuildConfiguration *MaemoRunConfiguration::activeQt4BuildConfiguration() cons
return static_cast<Qt4BuildConfiguration *>(activeBuildConfiguration());
}
bool MaemoRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration * /* config */) const
bool MaemoRunConfiguration::isEnabled() const
{
if (!m_validParse)
return false;
return true;
return m_validParse;
}
QWidget *MaemoRunConfiguration::createConfigurationWidget()
......
......@@ -80,8 +80,7 @@ public:
const QString &proFilePath);
virtual ~MaemoRunConfiguration();
using ProjectExplorer::RunConfiguration::isEnabled;
bool isEnabled(ProjectExplorer::BuildConfiguration *config) const;
bool isEnabled() const;
QWidget *createConfigurationWidget();
Utils::OutputFormatter *createOutputFormatter() const;
Qt4ProjectManager::Qt4BaseTarget *qt4Target() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment