Commit 5f9cb8fe authored by con's avatar con
Browse files

Results of review.

parent c22923c4
......@@ -122,7 +122,6 @@ public:
ProjectExplorer::ToolChain::ToolChainType toolChainType() const;
ProjectExplorer::ToolChain *toolChain(ProjectExplorer::BuildConfiguration *configuration) const;
bool parseCMakeLists();
protected:
virtual void saveSettingsImpl(ProjectExplorer::PersistentSettingsWriter &writer);
virtual bool restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader &reader);
......@@ -135,6 +134,7 @@ private slots:
void slotActiveBuildConfiguration();
private:
bool parseCMakeLists();
void updateToolChain(const QString &compiler);
void buildTree(CMakeProjectNode *rootNode, QList<ProjectExplorer::FileNode *> list);
......@@ -155,6 +155,8 @@ private:
ProjectExplorer::FileWatcher *m_watcher;
bool m_insideFileChanged;
QSet<QString> m_watchedFiles;
friend class CMakeBuildConfigurationFactory; // for parseCMakeLists
};
class CMakeCbpParser : public QXmlStreamReader
......
......@@ -33,10 +33,6 @@
using namespace ProjectExplorer;
BuildConfiguration::BuildConfiguration()
{
}
BuildConfiguration::BuildConfiguration(const QString &name)
: m_name(name)
{
......
......@@ -41,27 +41,30 @@
namespace ProjectExplorer {
class Project;
class PROJECTEXPLORER_EXPORT BuildConfiguration : public QObject
{
Q_OBJECT
public:
explicit BuildConfiguration();
BuildConfiguration(const QString &name);
BuildConfiguration(const QString &name, BuildConfiguration *source);
void setName(const QString &name);
QString name() const;
QString displayName() const;
void setDisplayName(const QString &name);
QVariant value(const QString &key) const;
void setValue(const QString &key, QVariant value);
QMap<QString, QVariant> toMap() const;
void setValuesFromMap(QMap<QString, QVariant> map);
private:
void setName(const QString &name);
QHash<QString, QVariant> m_values;
QString m_name;
friend class Project;
};
class PROJECTEXPLORER_EXPORT IBuildConfigurationFactory : public QObject
......
......@@ -272,6 +272,7 @@ void BuildSettingsWidget::createConfiguration()
QAction *action = qobject_cast<QAction *>(sender());
const QString &type = action->data().toString();
if (m_project->buildConfigurationFactory()->create(type)) {
// TODO switching to last buildconfiguration in list might not be what we want
m_buildConfiguration = m_project->buildConfigurations().last()->name();
updateBuildSettings();
}
......
......@@ -216,7 +216,7 @@ bool Project::restoreSettings()
if (!restoreSettingsImpl(reader))
return false;
if (m_activeBuildConfiguration.isEmpty() && !m_buildConfigurations.isEmpty())
if (m_activeBuildConfiguration.isEmpty() && !m_buildConfigurationValues.isEmpty())
setActiveBuildConfiguration(m_buildConfigurationValues.at(0));
if (!m_activeRunConfiguration && !m_runConfigurations.isEmpty())
......
......@@ -101,6 +101,7 @@ public:
void copyBuildConfiguration(const QString &source, const QString &dest);
BuildConfiguration *buildConfiguration(const QString & name) const;
QList<BuildConfiguration *> buildConfigurations() const;
// remove and add "QString uniqueConfigurationDisplayName(const QString &proposedName) const" instead
void setDisplayNameFor(BuildConfiguration *configuration, const QString &displayName);
BuildConfiguration *activeBuildConfiguration() const;
void setActiveBuildConfiguration(BuildConfiguration *configuration);
......@@ -184,7 +185,6 @@ protected:
private:
QList<BuildStep *> m_buildSteps;
QList<BuildStep *> m_cleanSteps;
QStringList m_buildConfigurations;
QMap<QString, QVariant> m_values;
QList<BuildConfiguration *> m_buildConfigurationValues;
QString m_activeBuildConfiguration;
......
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