Commit 2ab7d2ea authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer

Some documentation comment formatting and a rename

Renamed RunConfiguration::configurationWidget to
createConfigurationWidget.

Reviewed-by: dt
parent d8be1fbc
......@@ -202,7 +202,7 @@ bool CMakeRunConfiguration::fromMap(const QVariantMap &map)
return RunConfiguration::fromMap(map);
}
QWidget *CMakeRunConfiguration::configurationWidget()
QWidget *CMakeRunConfiguration::createConfigurationWidget()
{
return new CMakeRunConfigurationWidget(this);
}
......
......@@ -66,7 +66,7 @@ public:
QString workingDirectory() const;
QStringList commandLineArguments() const;
ProjectExplorer::Environment environment() const;
QWidget *configurationWidget();
QWidget *createConfigurationWidget();
void setExecutable(const QString &executable);
void setWorkingDirectory(const QString &workingDirectory);
......
......@@ -88,7 +88,7 @@ RunControl *DebuggerRunControlFactory::create(RunConfiguration *runConfiguration
return new DebuggerRunControl(m_manager, rc);
}
QWidget *DebuggerRunControlFactory::configurationWidget(RunConfiguration *runConfiguration)
QWidget *DebuggerRunControlFactory::createConfigurationWidget(RunConfiguration *runConfiguration)
{
// NBS TODO: Add GDB-specific configuration widget
Q_UNUSED(runConfiguration)
......
......@@ -52,7 +52,7 @@ public:
const QString &mode);
virtual QString displayName() const;
virtual QWidget *configurationWidget(ProjectExplorer::RunConfiguration *runConfiguration);
virtual QWidget *createConfigurationWidget(ProjectExplorer::RunConfiguration *runConfiguration);
ProjectExplorer::RunControl *create(const DebuggerStartParametersPtr &sp);
......
......@@ -83,7 +83,7 @@ RunControl *LocalApplicationRunControlFactory::create(ProjectExplorer::RunConfig
return new LocalApplicationRunControl(qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration));
}
QWidget *LocalApplicationRunControlFactory::configurationWidget(RunConfiguration *runConfiguration)
QWidget *LocalApplicationRunControlFactory::createConfigurationWidget(RunConfiguration *runConfiguration)
{
Q_UNUSED(runConfiguration)
return new QLabel("TODO add Configuration widget");
......
......@@ -74,7 +74,7 @@ public:
virtual bool canRun(RunConfiguration *runConfiguration, const QString &mode) const;
virtual QString displayName() const;
virtual RunControl* create(RunConfiguration *runConfiguration, const QString &mode);
virtual QWidget *configurationWidget(RunConfiguration *runConfiguration);
virtual QWidget *createConfigurationWidget(RunConfiguration *runConfiguration);
};
class LocalApplicationRunControl : public RunControl
......
......@@ -339,7 +339,7 @@ QString CustomExecutableRunConfiguration::executable() const
if (m_executable.isEmpty() || !QFileInfo(exec).exists()) {
// Oh the executable doesn't exists, ask the user.
QWidget *confWidget = const_cast<CustomExecutableRunConfiguration *>(this)->configurationWidget();
QWidget *confWidget = const_cast<CustomExecutableRunConfiguration *>(this)->createConfigurationWidget();
confWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
QDialog dialog(Core::ICore::instance()->mainWindow());
dialog.setLayout(new QVBoxLayout());
......@@ -514,7 +514,7 @@ void CustomExecutableRunConfiguration::setRunMode(RunMode runMode)
emit changed();
}
QWidget *CustomExecutableRunConfiguration::configurationWidget()
QWidget *CustomExecutableRunConfiguration::createConfigurationWidget()
{
return new CustomExecutableConfigurationWidget(this);
}
......
......@@ -98,7 +98,7 @@ public:
QStringList commandLineArguments() const;
Environment environment() const;
QWidget *configurationWidget();
QWidget *createConfigurationWidget();
QString dumperLibrary() const;
QStringList dumperLibraryLocations() const;
......
......@@ -48,7 +48,8 @@ class Target;
class RunControl;
class BuildConfiguration;
/* Base class for a run configuration. A run configuration specifies how a
/**
* Base class for a run configuration. A run configuration specifies how a
* target should be run, while the runner (see below) does the actual running.
*
* Note that all RunControls and the target hold a shared pointer to the RunConfiguration.
......@@ -65,17 +66,21 @@ class PROJECTEXPLORER_EXPORT RunConfiguration : public ProjectConfiguration
public:
virtual ~RunConfiguration();
// Used to find out whether a runconfiguration works with the given
// buildconfiguration.
// Note: bc may be 0!
/**
* Used to find out whether a runconfiguration works with the given
* buildconfiguration.
* \note bc may be 0!
*/
virtual bool isEnabled(BuildConfiguration *bc) const;
// Used to find out whether a runconfiguration works with the active
// buildconfiguration.
/**
* Used to find out whether a runconfiguration works with the active
* buildconfiguration.
*/
bool isEnabled() const;
// Returns the widget used to configure this run configuration. Ownership is transferred to the caller
// rename to createConfigurationWidget
virtual QWidget *configurationWidget() = 0;
/// Returns the widget used to configure this run configuration. Ownership is transferred to the caller
virtual QWidget *createConfigurationWidget() = 0;
Target *target() const;
......@@ -86,14 +91,15 @@ protected:
RunConfiguration(Target *parent, const QString &id);
RunConfiguration(Target *parent, RunConfiguration *source);
// convenience method to get current build configuration.
/// convenience method to get current build configuration.
BuildConfiguration *activeBuildConfiguration() const;
private:
Target *m_target;
};
/* The run configuration factory is used for restoring run configurations from
/**
* The run configuration factory is used for restoring run configurations from
* settings. And used to create new runconfigurations in the "Run Settings" Dialog.
* For the first case bool canRestore(Target *parent, const QString &id) and
* RunConfiguration* create(Target *parent, const QString &id) are used.
......@@ -101,8 +107,7 @@ private:
* QString displayNameForType(const QString&) are used to generate a list of creatable
* RunConfigurations, and create(..) is used to create it.
*/
class PROJECTEXPLORER_EXPORT IRunConfigurationFactory :
public QObject
class PROJECTEXPLORER_EXPORT IRunConfigurationFactory : public QObject
{
Q_OBJECT
......@@ -110,9 +115,10 @@ public:
explicit IRunConfigurationFactory(QObject *parent = 0);
virtual ~IRunConfigurationFactory();
// used to show the list of possible additons to a target, returns a list of types
/// used to show the list of possible additons to a target, returns a list of types
virtual QStringList availableCreationIds(Target *parent) const = 0;
// used to translate the types to names to display to the user
/// used to translate the types to names to display to the user
virtual QString displayNameForId(const QString &id) const = 0;
virtual bool canCreate(Target *parent, const QString &id) const = 0;
......@@ -142,13 +148,15 @@ public:
virtual QString displayName() const = 0;
// Returns the widget used to configure this runner. Ownership is transferred to the caller
virtual QWidget *configurationWidget(RunConfiguration *runConfiguration) = 0;
/// Returns the widget used to configure this runner. Ownership is transferred to the caller
virtual QWidget *createConfigurationWidget(RunConfiguration *runConfiguration) = 0;
};
/* Each instance of this class represents one item that is run.
/**
* Each instance of this class represents one item that is run.
*/
class PROJECTEXPLORER_EXPORT RunControl : public QObject {
class PROJECTEXPLORER_EXPORT RunControl : public QObject
{
Q_OBJECT
public:
explicit RunControl(RunConfiguration *runConfiguration);
......
......@@ -237,7 +237,7 @@ RunSettingsWidget::RunSettingsWidget(Target *target)
m_ui->removeToolButton->setEnabled(m_target->runConfigurations().size() > 1);
m_runConfigurationWidget = m_target->activeRunConfiguration()->configurationWidget();
m_runConfigurationWidget = m_target->activeRunConfiguration()->createConfigurationWidget();
layout()->addWidget(m_runConfigurationWidget);
connect(m_addMenu, SIGNAL(aboutToShow()),
......@@ -255,7 +255,7 @@ RunSettingsWidget::RunSettingsWidget(Target *target)
QList<IRunControlFactory *> runners = PluginManager::instance()->getObjects<IRunControlFactory>();
foreach (IRunControlFactory * runner, runners) {
if (runner->canRun(activeRunConfiguration))
m_ui->layout->addWidget(runner->configurationWidget(activeRunConfiguration));
m_ui->layout->addWidget(runner->createConfigurationWidget(activeRunConfiguration));
}
*/
}
......@@ -317,7 +317,7 @@ void RunSettingsWidget::activeRunConfigurationChanged()
m_ignoreChange = false;
delete m_runConfigurationWidget;
m_runConfigurationWidget = m_target->activeRunConfiguration()->configurationWidget();
m_runConfigurationWidget = m_target->activeRunConfiguration()->createConfigurationWidget();
layout()->addWidget(m_runConfigurationWidget);
}
......@@ -339,6 +339,6 @@ void RunSettingsWidget::currentRunConfigurationChanged(int index)
// Update the run configuration configuration widget
delete m_runConfigurationWidget;
m_runConfigurationWidget = selectedRunConfiguration->configurationWidget();
m_runConfigurationWidget = selectedRunConfiguration->createConfigurationWidget();
layout()->addWidget(m_runConfigurationWidget);
}
......@@ -163,7 +163,7 @@ static bool caseInsensitiveLessThan(const QString &s1, const QString &s2)
return s1.toLower() < s2.toLower();
}
QWidget *QmlProjectRunConfiguration::configurationWidget()
QWidget *QmlProjectRunConfiguration::createConfigurationWidget()
{
QWidget *config = new QWidget;
QFormLayout *form = new QFormLayout(config);
......
......@@ -80,7 +80,7 @@ public:
uint debugServerPort() const;
// RunConfiguration
virtual QWidget *configurationWidget();
virtual QWidget *createConfigurationWidget();
QVariantMap toMap() const;
......
......@@ -158,7 +158,7 @@ QString QmlRunControlFactory::displayName() const
return tr("Run");
}
QWidget *QmlRunControlFactory::configurationWidget(RunConfiguration *runConfiguration)
QWidget *QmlRunControlFactory::createConfigurationWidget(RunConfiguration *runConfiguration)
{
Q_UNUSED(runConfiguration)
return new QLabel("TODO add Configuration widget");
......
......@@ -74,7 +74,7 @@ public:
virtual bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode) const;
virtual ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode);
virtual QString displayName() const;
virtual QWidget *configurationWidget(ProjectExplorer::RunConfiguration *runConfiguration);
virtual QWidget *createConfigurationWidget(ProjectExplorer::RunConfiguration *runConfiguration);
};
} // namespace Internal
......
......@@ -142,7 +142,7 @@ bool MaemoRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *confi
return type == ToolChain::GCC_MAEMO;
}
QWidget *MaemoRunConfiguration::configurationWidget()
QWidget *MaemoRunConfiguration::createConfigurationWidget()
{
return new MaemoRunConfigurationWidget(this);
}
......
......@@ -65,7 +65,7 @@ public:
virtual ~MaemoRunConfiguration();
bool isEnabled(ProjectExplorer::BuildConfiguration *config) const;
QWidget *configurationWidget();
QWidget *createConfigurationWidget();
Qt4Target *qt4Target() const;
Qt4BuildConfiguration *activeQt4BuildConfiguration() const;
......
......@@ -287,7 +287,7 @@ QString MaemoRunControlFactory::displayName() const
return tr("Run on device");
}
QWidget* MaemoRunControlFactory::configurationWidget(RunConfiguration *config)
QWidget *MaemoRunControlFactory::createConfigurationWidget(RunConfiguration *config)
{
Q_UNUSED(config)
return 0;
......
......@@ -93,10 +93,10 @@ public:
~MaemoRunControlFactory();
QString displayName() const;
QWidget *configurationWidget(RunConfiguration *runConfiguration);
QWidget *createConfigurationWidget(RunConfiguration *runConfiguration);
bool canRun(RunConfiguration *runConfiguration, const QString &mode) const;
RunControl* create(RunConfiguration *runConfiguration, const QString &mode);
RunControl *create(RunConfiguration *runConfiguration, const QString &mode);
};
} // namespace Internal
......
......@@ -183,7 +183,7 @@ bool S60DeviceRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *c
return false;
}
QWidget *S60DeviceRunConfiguration::configurationWidget()
QWidget *S60DeviceRunConfiguration::createConfigurationWidget()
{
return new S60DeviceRunConfigurationWidget(this);
}
......
......@@ -71,7 +71,7 @@ public:
Qt4Target *qt4Target() const;
bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
QWidget *configurationWidget();
QWidget *createConfigurationWidget();
QString serialPortName() const;
void setSerialPortName(const QString &name);
......
......@@ -126,7 +126,7 @@ bool S60EmulatorRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration
return type == ToolChain::WINSCW;
}
QWidget *S60EmulatorRunConfiguration::configurationWidget()
QWidget *S60EmulatorRunConfiguration::createConfigurationWidget()
{
return new S60EmulatorRunConfigurationWidget(this);
}
......
......@@ -65,7 +65,7 @@ public:
Qt4Target *qt4Target() const;
bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
QWidget *configurationWidget();
QWidget *createConfigurationWidget();
QString executable() const;
......
......@@ -87,7 +87,7 @@ public:
return m_name;
}
QWidget *configurationWidget(ProjectExplorer::RunConfiguration * /*runConfiguration */) {
QWidget *createConfigurationWidget(ProjectExplorer::RunConfiguration * /*runConfiguration */) {
return 0;
}
......
......@@ -440,7 +440,7 @@ void Qt4RunConfigurationWidget::hideEvent(QHideEvent *event)
}
////// TODO c&p above
QWidget *Qt4RunConfiguration::configurationWidget()
QWidget *Qt4RunConfiguration::createConfigurationWidget()
{
return new Qt4RunConfigurationWidget(this, 0);
}
......
......@@ -75,7 +75,7 @@ public:
Qt4Target *qt4Target() const;
virtual bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
virtual QWidget *configurationWidget();
virtual QWidget *createConfigurationWidget();
virtual QString executable() const;
virtual RunMode runMode() 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