forked from qt-creator/qt-creator
Add BuildConfiguration classes
Each project has it's own BuildConfiguarion * classes, they'll get a decent type safe interface and the setValue/value stuff will be removed.
This commit is contained in:
42
src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
Normal file
42
src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** Commercial Usage
|
||||||
|
**
|
||||||
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||||
|
** accordance with the Qt Commercial License Agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
**
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** If you are unsure which license is appropriate for your use, please
|
||||||
|
** contact the sales department at http://qt.nokia.com/contact.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
#include "cmakebuildconfiguration.h"
|
||||||
|
|
||||||
|
CMakeBuildConfiguration::CMakeBuildConfiguration(const QString &name)
|
||||||
|
: BuildConfiguration(name)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
CMakeBuildConfiguration::CMakeBuildConfiguration(const QString &name, BuildConfiguration *source)
|
||||||
|
: BuildConfiguration(name, source)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
42
src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h
Normal file
42
src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** Commercial Usage
|
||||||
|
**
|
||||||
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||||
|
** accordance with the Qt Commercial License Agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
**
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** If you are unsure which license is appropriate for your use, please
|
||||||
|
** contact the sales department at http://qt.nokia.com/contact.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
#ifndef CMAKEBUILDCONFIGURATION_H
|
||||||
|
#define CMAKEBUILDCONFIGURATION_H
|
||||||
|
|
||||||
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
|
|
||||||
|
class CMakeBuildConfiguration : public ProjectExplorer::BuildConfiguration
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CMakeBuildConfiguration(const QString &name);
|
||||||
|
CMakeBuildConfiguration(const QString &name, BuildConfiguration *source);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CMAKEBUILDCONFIGURATION_H
|
@@ -34,6 +34,7 @@
|
|||||||
#include "makestep.h"
|
#include "makestep.h"
|
||||||
#include "cmakeopenprojectwizard.h"
|
#include "cmakeopenprojectwizard.h"
|
||||||
#include "cmakebuildenvironmentwidget.h"
|
#include "cmakebuildenvironmentwidget.h"
|
||||||
|
#include "cmakebuildconfiguration.h"
|
||||||
|
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <cpptools/cppmodelmanagerinterface.h>
|
#include <cpptools/cppmodelmanagerinterface.h>
|
||||||
@@ -103,7 +104,7 @@ bool CMakeBuildConfigurationFactory::create(const QString &type) const
|
|||||||
&ok);
|
&ok);
|
||||||
if (!ok || buildConfigurationName.isEmpty())
|
if (!ok || buildConfigurationName.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
BuildConfiguration *bc = new BuildConfiguration(buildConfigurationName);
|
BuildConfiguration *bc = new CMakeBuildConfiguration(buildConfigurationName);
|
||||||
|
|
||||||
MakeStep *makeStep = new MakeStep(m_project, bc);
|
MakeStep *makeStep = new MakeStep(m_project, bc);
|
||||||
bc->insertBuildStep(0, makeStep);
|
bc->insertBuildStep(0, makeStep);
|
||||||
@@ -132,6 +133,14 @@ bool CMakeBuildConfigurationFactory::create(const QString &type) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CMakeBuildConfigurationFactory::clone(const QString &name, ProjectExplorer::BuildConfiguration *source) const
|
||||||
|
{
|
||||||
|
CMakeBuildConfiguration *old = static_cast<CMakeBuildConfiguration *>(source);
|
||||||
|
CMakeBuildConfiguration *bc = new CMakeBuildConfiguration(name, old);
|
||||||
|
m_project->addBuildConfiguration(bc);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class CMakeProject
|
\class CMakeProject
|
||||||
*/
|
*/
|
||||||
@@ -649,7 +658,7 @@ bool CMakeProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader
|
|||||||
if (copw.exec() != QDialog::Accepted)
|
if (copw.exec() != QDialog::Accepted)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ProjectExplorer::BuildConfiguration *bc = new ProjectExplorer::BuildConfiguration("all");
|
CMakeBuildConfiguration *bc = new CMakeBuildConfiguration("all");
|
||||||
addBuildConfiguration(bc);
|
addBuildConfiguration(bc);
|
||||||
bc->setValue("msvcVersion", copw.msvcVersion());
|
bc->setValue("msvcVersion", copw.msvcVersion());
|
||||||
if (!copw.buildDirectory().isEmpty())
|
if (!copw.buildDirectory().isEmpty())
|
||||||
|
@@ -74,6 +74,7 @@ public:
|
|||||||
QString displayNameForType(const QString &type) const;
|
QString displayNameForType(const QString &type) const;
|
||||||
|
|
||||||
bool create(const QString &type) const;
|
bool create(const QString &type) const;
|
||||||
|
bool clone(const QString &name, ProjectExplorer::BuildConfiguration *source) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CMakeProject *m_project;
|
CMakeProject *m_project;
|
||||||
|
@@ -10,7 +10,8 @@ HEADERS = cmakeproject.h \
|
|||||||
makestep.h \
|
makestep.h \
|
||||||
cmakerunconfiguration.h \
|
cmakerunconfiguration.h \
|
||||||
cmakeopenprojectwizard.h \
|
cmakeopenprojectwizard.h \
|
||||||
cmakebuildenvironmentwidget.h
|
cmakebuildenvironmentwidget.h \
|
||||||
|
cmakebuildconfiguration.h
|
||||||
SOURCES = cmakeproject.cpp \
|
SOURCES = cmakeproject.cpp \
|
||||||
cmakeprojectplugin.cpp \
|
cmakeprojectplugin.cpp \
|
||||||
cmakeprojectmanager.cpp \
|
cmakeprojectmanager.cpp \
|
||||||
@@ -18,7 +19,8 @@ SOURCES = cmakeproject.cpp \
|
|||||||
makestep.cpp \
|
makestep.cpp \
|
||||||
cmakerunconfiguration.cpp \
|
cmakerunconfiguration.cpp \
|
||||||
cmakeopenprojectwizard.cpp \
|
cmakeopenprojectwizard.cpp \
|
||||||
cmakebuildenvironmentwidget.cpp
|
cmakebuildenvironmentwidget.cpp \
|
||||||
|
cmakebuildconfiguration.cpp
|
||||||
RESOURCES += cmakeproject.qrc
|
RESOURCES += cmakeproject.qrc
|
||||||
FORMS +=
|
FORMS +=
|
||||||
|
|
||||||
|
@@ -0,0 +1,46 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** Commercial Usage
|
||||||
|
**
|
||||||
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||||
|
** accordance with the Qt Commercial License Agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
**
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** If you are unsure which license is appropriate for your use, please
|
||||||
|
** contact the sales department at http://qt.nokia.com/contact.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
#include "genericbuildconfiguration.h"
|
||||||
|
|
||||||
|
using namespace GenericProjectManager;
|
||||||
|
using namespace GenericProjectManager::Internal;
|
||||||
|
using ProjectExplorer::BuildConfiguration;
|
||||||
|
|
||||||
|
GenericBuildConfiguration::GenericBuildConfiguration(const QString &name)
|
||||||
|
: BuildConfiguration(name)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
GenericBuildConfiguration::GenericBuildConfiguration(const QString &name, GenericBuildConfiguration *source)
|
||||||
|
: BuildConfiguration(name, source)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,48 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** Commercial Usage
|
||||||
|
**
|
||||||
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||||
|
** accordance with the Qt Commercial License Agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
**
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** If you are unsure which license is appropriate for your use, please
|
||||||
|
** contact the sales department at http://qt.nokia.com/contact.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
#ifndef GENERICBUILDCONFIGURATION_H
|
||||||
|
#define GENERICBUILDCONFIGURATION_H
|
||||||
|
|
||||||
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
|
|
||||||
|
namespace GenericProjectManager {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
|
||||||
|
class GenericBuildConfiguration : public ProjectExplorer::BuildConfiguration
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
GenericBuildConfiguration(const QString &name);
|
||||||
|
GenericBuildConfiguration(const QString &name, GenericBuildConfiguration *source);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace GenericProjectManager
|
||||||
|
} // namespace Internal
|
||||||
|
#endif // GENERICBUILDCONFIGURATION_H
|
@@ -30,6 +30,7 @@
|
|||||||
#include "genericproject.h"
|
#include "genericproject.h"
|
||||||
#include "genericprojectconstants.h"
|
#include "genericprojectconstants.h"
|
||||||
#include "genericmakestep.h"
|
#include "genericmakestep.h"
|
||||||
|
#include "genericbuildconfiguration.h"
|
||||||
|
|
||||||
#include <projectexplorer/toolchain.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
@@ -145,7 +146,7 @@ bool GenericBuildConfigurationFactory::create(const QString &type) const
|
|||||||
&ok);
|
&ok);
|
||||||
if (!ok || buildConfigurationName.isEmpty())
|
if (!ok || buildConfigurationName.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
BuildConfiguration *bc = new BuildConfiguration(buildConfigurationName);
|
GenericBuildConfiguration *bc = new GenericBuildConfiguration(buildConfigurationName);
|
||||||
m_project->addBuildConfiguration(bc); // also makes the name unique...
|
m_project->addBuildConfiguration(bc); // also makes the name unique...
|
||||||
|
|
||||||
GenericMakeStep *makeStep = new GenericMakeStep(m_project, bc);
|
GenericMakeStep *makeStep = new GenericMakeStep(m_project, bc);
|
||||||
@@ -154,6 +155,14 @@ bool GenericBuildConfigurationFactory::create(const QString &type) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GenericBuildConfigurationFactory::clone(const QString &name, BuildConfiguration *source) const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
GenericBuildConfiguration *bc = new GenericBuildConfiguration(name, static_cast<GenericBuildConfiguration *>(source));
|
||||||
|
m_project->addBuildConfiguration(bc);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////
|
||||||
// GenericProject
|
// GenericProject
|
||||||
////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -518,7 +527,7 @@ bool GenericProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsRead
|
|||||||
Project::restoreSettingsImpl(reader);
|
Project::restoreSettingsImpl(reader);
|
||||||
|
|
||||||
if (buildConfigurations().isEmpty()) {
|
if (buildConfigurations().isEmpty()) {
|
||||||
ProjectExplorer::BuildConfiguration *bc = new BuildConfiguration("all");
|
GenericBuildConfiguration *bc = new GenericBuildConfiguration("all");
|
||||||
addBuildConfiguration(bc);
|
addBuildConfiguration(bc);
|
||||||
|
|
||||||
GenericMakeStep *makeStep = new GenericMakeStep(this, bc);
|
GenericMakeStep *makeStep = new GenericMakeStep(this, bc);
|
||||||
|
@@ -67,6 +67,7 @@ public:
|
|||||||
QString displayNameForType(const QString &type) const;
|
QString displayNameForType(const QString &type) const;
|
||||||
|
|
||||||
bool create(const QString &type) const;
|
bool create(const QString &type) const;
|
||||||
|
bool clone(const QString &name, ProjectExplorer::BuildConfiguration *source) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GenericProject *m_project;
|
GenericProject *m_project;
|
||||||
|
@@ -10,7 +10,8 @@ HEADERS = genericproject.h \
|
|||||||
genericprojectwizard.h \
|
genericprojectwizard.h \
|
||||||
genericprojectfileseditor.h \
|
genericprojectfileseditor.h \
|
||||||
pkgconfigtool.h \
|
pkgconfigtool.h \
|
||||||
genericmakestep.h
|
genericmakestep.h \
|
||||||
|
genericbuildconfiguration.h
|
||||||
SOURCES = genericproject.cpp \
|
SOURCES = genericproject.cpp \
|
||||||
genericprojectplugin.cpp \
|
genericprojectplugin.cpp \
|
||||||
genericprojectmanager.cpp \
|
genericprojectmanager.cpp \
|
||||||
@@ -18,8 +19,8 @@ SOURCES = genericproject.cpp \
|
|||||||
genericprojectwizard.cpp \
|
genericprojectwizard.cpp \
|
||||||
genericprojectfileseditor.cpp \
|
genericprojectfileseditor.cpp \
|
||||||
pkgconfigtool.cpp \
|
pkgconfigtool.cpp \
|
||||||
genericmakestep.cpp
|
genericmakestep.cpp \
|
||||||
|
genericbuildconfiguration.cpp
|
||||||
RESOURCES += genericproject.qrc
|
RESOURCES += genericproject.qrc
|
||||||
FORMS += genericmakestep.ui
|
FORMS += genericmakestep.ui
|
||||||
|
|
||||||
OTHER_FILES += GenericProjectManager.pluginspec
|
OTHER_FILES += GenericProjectManager.pluginspec
|
||||||
|
@@ -50,13 +50,14 @@ class PROJECTEXPLORER_EXPORT BuildConfiguration : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BuildConfiguration(const QString &name);
|
// ctors are protected
|
||||||
BuildConfiguration(const QString &name, BuildConfiguration *source);
|
virtual ~BuildConfiguration();
|
||||||
~BuildConfiguration();
|
|
||||||
QString name() const;
|
QString name() const;
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
void setDisplayName(const QString &name);
|
void setDisplayName(const QString &name);
|
||||||
|
|
||||||
|
// TODO remove those
|
||||||
QVariant value(const QString &key) const;
|
QVariant value(const QString &key) const;
|
||||||
void setValue(const QString &key, QVariant value);
|
void setValue(const QString &key, QVariant value);
|
||||||
|
|
||||||
@@ -73,6 +74,10 @@ public:
|
|||||||
void removeCleanStep(int position);
|
void removeCleanStep(int position);
|
||||||
void moveCleanStepUp(int position);
|
void moveCleanStepUp(int position);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
BuildConfiguration(const QString &name);
|
||||||
|
BuildConfiguration(const QString &name, BuildConfiguration *source);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setName(const QString &name);
|
void setName(const QString &name);
|
||||||
|
|
||||||
@@ -101,6 +106,14 @@ public:
|
|||||||
// returns true if build configuration(s) actually have been added
|
// returns true if build configuration(s) actually have been added
|
||||||
virtual bool create(const QString &type) const = 0;
|
virtual bool create(const QString &type) const = 0;
|
||||||
|
|
||||||
|
// clones a given BuildConfiguration
|
||||||
|
virtual bool clone(const QString &name, BuildConfiguration *source) const = 0;
|
||||||
|
|
||||||
|
// TODO All those methods make the internal name (and display name) unique,
|
||||||
|
// but in different ways
|
||||||
|
|
||||||
|
//virtual bool restore(const QString &name);
|
||||||
|
|
||||||
// to come:
|
// to come:
|
||||||
// restore
|
// restore
|
||||||
// clone
|
// clone
|
||||||
|
@@ -356,7 +356,10 @@ void BuildSettingsWidget::cloneConfiguration(const QString &sourceConfiguration)
|
|||||||
|
|
||||||
newBuildConfiguration = Project::makeUnique(newBuildConfiguration, buildConfigurationNames);
|
newBuildConfiguration = Project::makeUnique(newBuildConfiguration, buildConfigurationNames);
|
||||||
|
|
||||||
m_project->copyBuildConfiguration(sourceConfiguration, newBuildConfiguration);
|
BuildConfiguration *sourceBc = m_project->buildConfiguration(sourceConfiguration);
|
||||||
|
|
||||||
|
m_project->buildConfigurationFactory()->clone(newBuildConfiguration, sourceBc);
|
||||||
|
|
||||||
m_project->setDisplayNameFor(m_project->buildConfiguration(newBuildConfiguration), newDisplayName);
|
m_project->setDisplayNameFor(m_project->buildConfiguration(newBuildConfiguration), newDisplayName);
|
||||||
|
|
||||||
m_buildConfiguration = newBuildConfiguration;
|
m_buildConfiguration = newBuildConfiguration;
|
||||||
|
@@ -109,17 +109,6 @@ void Project::removeBuildConfiguration(BuildConfiguration *configuration)
|
|||||||
delete configuration;
|
delete configuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Project::copyBuildConfiguration(const QString &source, const QString &dest)
|
|
||||||
{
|
|
||||||
BuildConfiguration *sourceConfiguration = buildConfiguration(source);
|
|
||||||
if (!sourceConfiguration)
|
|
||||||
return;
|
|
||||||
|
|
||||||
m_buildConfigurationValues.push_back(new BuildConfiguration(dest, sourceConfiguration));
|
|
||||||
|
|
||||||
emit addedBuildConfiguration(this, dest);
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<BuildConfiguration *> Project::buildConfigurations() const
|
QList<BuildConfiguration *> Project::buildConfigurations() const
|
||||||
{
|
{
|
||||||
return m_buildConfigurationValues;
|
return m_buildConfigurationValues;
|
||||||
|
@@ -86,7 +86,7 @@ public:
|
|||||||
// Build configuration
|
// Build configuration
|
||||||
void addBuildConfiguration(BuildConfiguration *configuration);
|
void addBuildConfiguration(BuildConfiguration *configuration);
|
||||||
void removeBuildConfiguration(BuildConfiguration *configuration);
|
void removeBuildConfiguration(BuildConfiguration *configuration);
|
||||||
void copyBuildConfiguration(const QString &source, const QString &dest);
|
|
||||||
BuildConfiguration *buildConfiguration(const QString & name) const;
|
BuildConfiguration *buildConfiguration(const QString & name) const;
|
||||||
QList<BuildConfiguration *> buildConfigurations() const;
|
QList<BuildConfiguration *> buildConfigurations() const;
|
||||||
// remove and add "QString uniqueConfigurationDisplayName(const QString &proposedName) const" instead
|
// remove and add "QString uniqueConfigurationDisplayName(const QString &proposedName) const" instead
|
||||||
|
@@ -853,7 +853,6 @@ Project *SessionManager::projectForFile(const QString &fileName) const
|
|||||||
foreach (Project *p, projectList)
|
foreach (Project *p, projectList)
|
||||||
if (p != currentProject && projectContainsFile(p, fileName))
|
if (p != currentProject && projectContainsFile(p, fileName))
|
||||||
return p;
|
return p;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
51
src/plugins/qt4projectmanager/qt4buildconfiguration.cpp
Normal file
51
src/plugins/qt4projectmanager/qt4buildconfiguration.cpp
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** Commercial Usage
|
||||||
|
**
|
||||||
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||||
|
** accordance with the Qt Commercial License Agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
**
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** If you are unsure which license is appropriate for your use, please
|
||||||
|
** contact the sales department at http://qt.nokia.com/contact.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
#include "qt4buildconfiguration.h"
|
||||||
|
|
||||||
|
using namespace Qt4ProjectManager;
|
||||||
|
using namespace Qt4ProjectManager::Internal;
|
||||||
|
using ProjectExplorer::BuildConfiguration;
|
||||||
|
|
||||||
|
Qt4BuildConfiguration::Qt4BuildConfiguration(const QString &name)
|
||||||
|
: BuildConfiguration(name)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Qt4BuildConfiguration::Qt4BuildConfiguration(const QString &name, Qt4BuildConfiguration *source)
|
||||||
|
: BuildConfiguration(name, source)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Qt4BuildConfiguration::~Qt4BuildConfiguration()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
50
src/plugins/qt4projectmanager/qt4buildconfiguration.h
Normal file
50
src/plugins/qt4projectmanager/qt4buildconfiguration.h
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** Commercial Usage
|
||||||
|
**
|
||||||
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||||
|
** accordance with the Qt Commercial License Agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
**
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** If you are unsure which license is appropriate for your use, please
|
||||||
|
** contact the sales department at http://qt.nokia.com/contact.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
#ifndef QT4BUILDCONFIGURATION_H
|
||||||
|
#define QT4BUILDCONFIGURATION_H
|
||||||
|
|
||||||
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
|
|
||||||
|
namespace Qt4ProjectManager {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
class Qt4BuildConfiguration : public ProjectExplorer::BuildConfiguration
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Qt4BuildConfiguration(const QString &name);
|
||||||
|
// copy ctor
|
||||||
|
Qt4BuildConfiguration(const QString &name, Qt4BuildConfiguration *source);
|
||||||
|
~Qt4BuildConfiguration();
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Qt4ProjectManager
|
||||||
|
} // namespace Internal
|
||||||
|
|
||||||
|
#endif // QT4BUILDCONFIGURATION_H
|
@@ -41,6 +41,7 @@
|
|||||||
#include "qt4projectmanagerconstants.h"
|
#include "qt4projectmanagerconstants.h"
|
||||||
#include "projectloadwizard.h"
|
#include "projectloadwizard.h"
|
||||||
#include "qtversionmanager.h"
|
#include "qtversionmanager.h"
|
||||||
|
#include "qt4buildconfiguration.h"
|
||||||
|
|
||||||
#ifdef QTCREATOR_WITH_S60
|
#ifdef QTCREATOR_WITH_S60
|
||||||
#include "qt-s60/gccetoolchain.h"
|
#include "qt-s60/gccetoolchain.h"
|
||||||
@@ -295,6 +296,14 @@ bool Qt4BuildConfigurationFactory::create(const QString &type) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Qt4BuildConfigurationFactory::clone(const QString &name, BuildConfiguration *source) const
|
||||||
|
{
|
||||||
|
Qt4BuildConfiguration *oldbc = static_cast<Qt4BuildConfiguration *>(source);
|
||||||
|
Qt4BuildConfiguration *newbc = new Qt4BuildConfiguration(name, oldbc);
|
||||||
|
m_project->addBuildConfiguration(newbc);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class Qt4Project
|
\class Qt4Project
|
||||||
|
|
||||||
@@ -443,7 +452,7 @@ void Qt4Project::addQt4BuildConfiguration(QString buildConfigurationName, QtVers
|
|||||||
bool debug = qmakeBuildConfiguration & QtVersion::DebugBuild;
|
bool debug = qmakeBuildConfiguration & QtVersion::DebugBuild;
|
||||||
|
|
||||||
// Add the buildconfiguration
|
// Add the buildconfiguration
|
||||||
ProjectExplorer::BuildConfiguration *bc = new ProjectExplorer::BuildConfiguration(buildConfigurationName);
|
Qt4BuildConfiguration *bc = new Qt4BuildConfiguration(buildConfigurationName);
|
||||||
addBuildConfiguration(bc);
|
addBuildConfiguration(bc);
|
||||||
|
|
||||||
QMakeStep *qmakeStep = new QMakeStep(this, bc);
|
QMakeStep *qmakeStep = new QMakeStep(this, bc);
|
||||||
|
@@ -131,6 +131,7 @@ public:
|
|||||||
QString displayNameForType(const QString &type) const;
|
QString displayNameForType(const QString &type) const;
|
||||||
|
|
||||||
bool create(const QString &type) const;
|
bool create(const QString &type) const;
|
||||||
|
bool clone(const QString &name, ProjectExplorer::BuildConfiguration *source) const;
|
||||||
|
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
|
@@ -165,8 +165,7 @@ void Qt4ProjectConfigWidget::init(const QString &buildConfiguration)
|
|||||||
|
|
||||||
void Qt4ProjectConfigWidget::changeConfigName(const QString &newName)
|
void Qt4ProjectConfigWidget::changeConfigName(const QString &newName)
|
||||||
{
|
{
|
||||||
m_pro->setDisplayNameFor(
|
m_pro->setDisplayNameFor(m_pro->buildConfiguration(m_buildConfiguration), newName);
|
||||||
m_pro->buildConfiguration(m_buildConfiguration), newName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4ProjectConfigWidget::setupQtVersionsComboBox()
|
void Qt4ProjectConfigWidget::setupQtVersionsComboBox()
|
||||||
|
@@ -39,7 +39,8 @@ HEADERS += qt4projectmanagerplugin.h \
|
|||||||
qtuicodemodelsupport.h \
|
qtuicodemodelsupport.h \
|
||||||
externaleditors.h \
|
externaleditors.h \
|
||||||
gettingstartedwelcomepagewidget.h \
|
gettingstartedwelcomepagewidget.h \
|
||||||
gettingstartedwelcomepage.h
|
gettingstartedwelcomepage.h \
|
||||||
|
qt4buildconfiguration.h
|
||||||
SOURCES += qt4projectmanagerplugin.cpp \
|
SOURCES += qt4projectmanagerplugin.cpp \
|
||||||
qt4projectmanager.cpp \
|
qt4projectmanager.cpp \
|
||||||
qt4project.cpp \
|
qt4project.cpp \
|
||||||
@@ -74,7 +75,8 @@ SOURCES += qt4projectmanagerplugin.cpp \
|
|||||||
qtuicodemodelsupport.cpp \
|
qtuicodemodelsupport.cpp \
|
||||||
externaleditors.cpp \
|
externaleditors.cpp \
|
||||||
gettingstartedwelcomepagewidget.cpp \
|
gettingstartedwelcomepagewidget.cpp \
|
||||||
gettingstartedwelcomepage.cpp
|
gettingstartedwelcomepage.cpp \
|
||||||
|
qt4buildconfiguration.cpp
|
||||||
FORMS += makestep.ui \
|
FORMS += makestep.ui \
|
||||||
qmakestep.ui \
|
qmakestep.ui \
|
||||||
qt4projectconfigwidget.ui \
|
qt4projectconfigwidget.ui \
|
||||||
|
Reference in New Issue
Block a user