Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
21565b99
Commit
21565b99
authored
Sep 21, 2009
by
con
Browse files
Export the build configuration class.
parent
69e00d8f
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/buildconfiguration.cpp
View file @
21565b99
...
...
@@ -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
=
getV
alue
(
"ProjectExplorer.BuildConfiguration.DisplayName"
);
QVariant
v
=
v
alue
(
"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
::
getV
alue
(
const
QString
&
key
)
const
QVariant
BuildConfiguration
::
v
alue
(
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
;
}
src/plugins/projectexplorer/buildconfiguration.h
View file @
21565b99
...
...
@@ -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
getV
alue
(
const
QString
&
key
)
const
;
QVariant
v
alue
(
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
src/plugins/projectexplorer/buildstep.cpp
View file @
21565b99
...
...
@@ -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
->
getV
alue
(
name
);
return
bc
->
v
alue
(
name
);
else
return
QVariant
();
}
QVariant
BuildStep
::
value
(
const
QString
&
name
)
const
{
return
m_configuration
->
getV
alue
(
name
);
return
m_configuration
->
v
alue
(
name
);
}
void
BuildStep
::
setValuesFromMap
(
const
QMap
<
QString
,
QVariant
>
&
values
)
...
...
src/plugins/projectexplorer/buildstep.h
View file @
21565b99
...
...
@@ -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
;
};
...
...
src/plugins/projectexplorer/project.cpp
View file @
21565b99
...
...
@@ -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
->
getV
alue
(
name
);
return
bc
->
v
alue
(
name
);
else
return
QVariant
();
}
...
...
src/plugins/projectexplorer/project.h
View file @
21565b99
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment