forked from qt-creator/qt-creator
ProjectExplorer: Add some BaseStringListAspect
Only for storage now, sufficient for the upcoming use in MakeStep. Change-Id: Ia84595c6cd50f75c70ccef2afb366db3da0e51ff Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -140,6 +140,12 @@ public:
|
||||
bool m_enabled = true;
|
||||
};
|
||||
|
||||
class BaseStringListAspectPrivate
|
||||
{
|
||||
public:
|
||||
QStringList m_value;
|
||||
};
|
||||
|
||||
} // Internal
|
||||
|
||||
/*!
|
||||
@@ -785,4 +791,41 @@ TriState TriState::fromVariant(const QVariant &variant)
|
||||
return TriState(Value(v));
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\class ProjectExplorer::BaseStringListAspect
|
||||
*/
|
||||
|
||||
BaseStringListAspect::BaseStringListAspect()
|
||||
: d(new Internal::BaseStringListAspectPrivate)
|
||||
{}
|
||||
|
||||
BaseStringListAspect::~BaseStringListAspect() = default;
|
||||
|
||||
void BaseStringListAspect::addToLayout(LayoutBuilder &builder)
|
||||
{
|
||||
Q_UNUSED(builder)
|
||||
// TODO - when needed.
|
||||
}
|
||||
|
||||
void BaseStringListAspect::fromMap(const QVariantMap &map)
|
||||
{
|
||||
d->m_value = map.value(settingsKey()).toStringList();
|
||||
}
|
||||
|
||||
void BaseStringListAspect::toMap(QVariantMap &data) const
|
||||
{
|
||||
data.insert(settingsKey(), d->m_value);
|
||||
}
|
||||
|
||||
QStringList BaseStringListAspect::value() const
|
||||
{
|
||||
return d->m_value;
|
||||
}
|
||||
|
||||
void BaseStringListAspect::setValue(const QStringList &value)
|
||||
{
|
||||
d->m_value = value;
|
||||
}
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
@@ -42,9 +42,10 @@ namespace ProjectExplorer {
|
||||
|
||||
namespace Internal {
|
||||
class BaseBoolAspectPrivate;
|
||||
class BaseStringAspectPrivate;
|
||||
class BaseIntegerAspectPrivate;
|
||||
class BaseSelectionAspectPrivate;
|
||||
class BaseStringAspectPrivate;
|
||||
class BaseStringListAspectPrivate;
|
||||
} // Internal
|
||||
|
||||
class PROJECTEXPLORER_EXPORT BaseBoolAspect : public ProjectConfigurationAspect
|
||||
@@ -231,4 +232,24 @@ public:
|
||||
void setSetting(TriState setting);
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT BaseStringListAspect : public ProjectConfigurationAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BaseStringListAspect();
|
||||
~BaseStringListAspect() override;
|
||||
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
|
||||
QStringList value() const;
|
||||
void setValue(const QStringList &val);
|
||||
|
||||
void fromMap(const QVariantMap &map) override;
|
||||
void toMap(QVariantMap &map) const override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<Internal::BaseStringListAspectPrivate> d;
|
||||
};
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
Reference in New Issue
Block a user