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:
hjk
2020-07-21 08:48:06 +02:00
parent faa707e932
commit 6775eeefc5
2 changed files with 65 additions and 1 deletions

View File

@@ -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