Commit 21565b99 authored by con's avatar con
Browse files

Export the build configuration class.

parent 69e00d8f
......@@ -29,7 +29,11 @@
#include "buildconfiguration.h"
using namespace ProjectExplorer::Internal;
using namespace ProjectExplorer;
BuildConfiguration::BuildConfiguration()
{
}
BuildConfiguration::BuildConfiguration(const QString &name)
: m_name(name)
......@@ -49,7 +53,7 @@ QString BuildConfiguration::name() const
QString BuildConfiguration::displayName()
{
QVariant v = getValue("ProjectExplorer.BuildConfiguration.DisplayName");
QVariant v = value("ProjectExplorer.BuildConfiguration.DisplayName");
if (v.isValid()) {
return v.toString();
} else {
......@@ -63,7 +67,7 @@ void BuildConfiguration::setDisplayName(const QString &name)
setValue("ProjectExplorer.BuildConfiguration.DisplayName", name);
}
QVariant BuildConfiguration::getValue(const QString & key) const
QVariant BuildConfiguration::value(const QString & key) const
{
QHash<QString, QVariant>::const_iterator it = m_values.find(key);
if (it != m_values.constEnd())
......@@ -94,4 +98,3 @@ QMap<QString, QVariant> BuildConfiguration::toMap() const
result.insert(it.key(), it.value());
return result;
}
......@@ -30,20 +30,26 @@
#ifndef BUILDCONFIGURATION_H
#define BUILDCONFIGURATION_H
#include "projectexplorer_export.h"
#include <QtCore/QHash>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QObject>
#include <QtCore/QVariant>
#include <QtCore/QHash>
namespace ProjectExplorer {
namespace Internal {
class BuildConfiguration
class PROJECTEXPLORER_EXPORT BuildConfiguration : public QObject
{
Q_OBJECT
public:
explicit BuildConfiguration();
BuildConfiguration(const QString &name);
BuildConfiguration(const QString &name, BuildConfiguration *source);
QString name() const;
QVariant getValue(const QString &key) const;
QVariant value(const QString &key) const;
void setValue(const QString &key, QVariant value);
QString displayName();
......@@ -57,7 +63,6 @@ private:
QString m_name;
};
}
} // namespace ProjectExplorer
#endif // BUILDCONFIGURATION_H
......@@ -35,7 +35,6 @@
#include <QtGui/QLayout>
using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal;
BuildStep::BuildStep(Project * pro)
: m_project(pro)
......@@ -92,14 +91,14 @@ QVariant BuildStep::value(const QString &buildConfiguration, const QString &name
{
BuildConfiguration *bc = getBuildConfiguration(buildConfiguration);
if (bc)
return bc->getValue(name);
return bc->value(name);
else
return QVariant();
}
QVariant BuildStep::value(const QString &name) const
{
return m_configuration->getValue(name);
return m_configuration->value(name);
}
void BuildStep::setValuesFromMap(const QMap<QString, QVariant> & values)
......
......@@ -39,9 +39,7 @@
namespace ProjectExplorer {
class Project;
namespace Internal {
class BuildConfiguration;
}
/*
// BuildSteps are the primary way plugin developers can customize
......@@ -132,14 +130,14 @@ Q_SIGNALS:
void addToOutputWindow(const QString &string);
private:
QList<Internal::BuildConfiguration *> buildConfigurations();
QList<BuildConfiguration *> buildConfigurations();
void addBuildConfiguration(const QString & name);
void removeBuildConfiguration(const QString & name);
Internal::BuildConfiguration *getBuildConfiguration(const QString & name) const;
BuildConfiguration *getBuildConfiguration(const QString & name) const;
void copyBuildConfiguration(const QString &source, const QString &dest);
QList<Internal::BuildConfiguration *> m_buildConfigurations;
Internal::BuildConfiguration *m_configuration;
QList<BuildConfiguration *> m_buildConfigurations;
BuildConfiguration *m_configuration;
Project *m_project;
};
......
......@@ -410,7 +410,7 @@ QVariant Project::value(const QString &name) const
return QVariant();
}
BuildConfiguration * Project::getBuildConfiguration(const QString &name) const
BuildConfiguration *Project::getBuildConfiguration(const QString &name) const
{
for (int i = 0; i != m_buildConfigurationValues.size(); ++i)
if (m_buildConfigurationValues.at(i)->name() == name)
......@@ -429,7 +429,7 @@ QVariant Project::value(const QString &buildConfiguration, const QString &name)
{
BuildConfiguration *bc = getBuildConfiguration(buildConfiguration);
if (bc)
return bc->getValue(name);
return bc->value(name);
else
return QVariant();
}
......
......@@ -191,13 +191,13 @@ protected:
virtual bool restoreSettingsImpl(PersistentSettingsReader &reader);
private:
Internal::BuildConfiguration *getBuildConfiguration(const QString & name) const;
BuildConfiguration *getBuildConfiguration(const QString & name) const;
QList<BuildStep *> m_buildSteps;
QList<BuildStep *> m_cleanSteps;
QStringList m_buildConfigurations;
QMap<QString, QVariant> m_values;
QList<Internal::BuildConfiguration *> m_buildConfigurationValues;
QList<BuildConfiguration *> m_buildConfigurationValues;
QString m_activeBuildConfiguration;
QList<QSharedPointer<RunConfiguration> > m_runConfigurations;
QSharedPointer<RunConfiguration> m_activeRunConfiguration;
......
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