Commit 7a37897f authored by Tobias Hunger's avatar Tobias Hunger

Kit: Allow creation of kits with a given id

This is to avoid creating lots of Core::Ids due to temporary kits,
etc.

Change-Id: Id786e3412aadae7a594f6caf64d0dd364744d296
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 88f362aa
......@@ -78,11 +78,14 @@ namespace Internal {
class KitPrivate
{
public:
KitPrivate() :
m_id(QUuid::createUuid().toString().toLatin1().constData()),
KitPrivate(Core::Id id) :
m_id(id),
m_autodetected(false),
m_isValid(true)
{ }
{
if (!id.isValid())
m_id = Core::Id(QUuid::createUuid().toString().toLatin1().constData());
}
QString m_displayName;
Core::Id m_id;
......@@ -100,8 +103,8 @@ public:
// Kit:
// -------------------------------------------------------------------------
Kit::Kit() :
d(new Internal::KitPrivate)
Kit::Kit(Core::Id id) :
d(new Internal::KitPrivate(id))
{
KitManager *stm = KitManager::instance();
foreach (KitInformation *sti, stm->kitInformation())
......
......@@ -55,7 +55,7 @@ class KitPrivate;
class PROJECTEXPLORER_EXPORT Kit
{
public:
Kit();
Kit(Core::Id id = Core::Id());
~Kit();
bool isValid() const;
......
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