forked from qt-creator/qt-creator
QmlDesigner: Remove project type traits
Project type traits are increasing the code complexity in the updater by quite lot. The discover can be done in an other way too. Change-Id: Ied9b7df445e854c76243ece6666690ea10b8d33d Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -75,8 +75,6 @@ public:
|
||||
|
||||
MetaInfoType type() const;
|
||||
bool isFileComponent() const;
|
||||
bool isProjectComponent() const;
|
||||
bool isInProjectModule() const;
|
||||
FlagIs canBeContainer() const;
|
||||
FlagIs forceClip() const;
|
||||
FlagIs doesLayoutChildren() const;
|
||||
|
||||
@@ -1538,44 +1538,6 @@ bool NodeMetaInfo::isFileComponent() const
|
||||
}
|
||||
}
|
||||
|
||||
bool NodeMetaInfo::isProjectComponent() const
|
||||
{
|
||||
if constexpr (useProjectStorage()) {
|
||||
if (!isValid())
|
||||
return false;
|
||||
|
||||
using NanotraceHR::keyValue;
|
||||
NanotraceHR::Tracer tracer{"is project component"_t, category(), keyValue("type id", m_typeId)};
|
||||
|
||||
auto isProjectComponent = typeData().traits.isProjectComponent;
|
||||
|
||||
tracer.end(keyValue("is project component", isProjectComponent));
|
||||
|
||||
return isProjectComponent;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool NodeMetaInfo::isInProjectModule() const
|
||||
{
|
||||
if constexpr (useProjectStorage()) {
|
||||
if (!isValid())
|
||||
return false;
|
||||
|
||||
using NanotraceHR::keyValue;
|
||||
NanotraceHR::Tracer tracer{"is project module"_t, category(), keyValue("type id", m_typeId)};
|
||||
|
||||
auto isInProjectModule = typeData().traits.isInProjectModule;
|
||||
|
||||
tracer.end(keyValue("is project module", isInProjectModule));
|
||||
|
||||
return isInProjectModule;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
FlagIs NodeMetaInfo::canBeContainer() const
|
||||
{
|
||||
if constexpr (useProjectStorage()) {
|
||||
|
||||
@@ -131,8 +131,6 @@ struct TypeTraits
|
||||
: kind{TypeTraitsKind::None}
|
||||
, isEnum{false}
|
||||
, isFileComponent{false}
|
||||
, isProjectComponent{false}
|
||||
, isInProjectModule{false}
|
||||
, usesCustomParser{false}
|
||||
, dummy{0U}
|
||||
, canBeContainer{FlagIs::False}
|
||||
@@ -181,8 +179,6 @@ struct TypeTraits
|
||||
keyValue("kind", typeTraits.kind),
|
||||
keyValue("is enum", typeTraits.isEnum),
|
||||
keyValue("is file component", typeTraits.isFileComponent),
|
||||
keyValue("is project component", typeTraits.isProjectComponent),
|
||||
keyValue("is in project module", typeTraits.isInProjectModule),
|
||||
keyValue("uses custom parser", typeTraits.usesCustomParser),
|
||||
keyValue("can be container", typeTraits.canBeContainer),
|
||||
keyValue("force clip", typeTraits.forceClip),
|
||||
@@ -207,10 +203,8 @@ struct TypeTraits
|
||||
TypeTraitsKind kind : 4;
|
||||
unsigned int isEnum : 1;
|
||||
unsigned int isFileComponent : 1;
|
||||
unsigned int isProjectComponent : 1;
|
||||
unsigned int isInProjectModule : 1;
|
||||
unsigned int usesCustomParser : 1;
|
||||
unsigned int dummy : 23;
|
||||
unsigned int dummy : 25;
|
||||
};
|
||||
|
||||
unsigned int type;
|
||||
|
||||
Reference in New Issue
Block a user