summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e6f8101)
Well, maybe it didn't seem so weird a decade ago, but these days
we can do type registration in a nicer way.
_opIconLimit(UserCategoryItem::categoryFromModes("o")),
_voiceIconLimit(UserCategoryItem::categoryFromModes("v"))
{
_opIconLimit(UserCategoryItem::categoryFromModes("o")),
_voiceIconLimit(UserCategoryItem::categoryFromModes("v"))
{
- // register FormatList if that hasn't happened yet
- // FIXME I don't think this actually avoids double registration... then again... does it hurt?
- if (QVariant::nameToType("UiStyle::FormatList") == QVariant::Invalid) {
- qRegisterMetaType<FormatList>("UiStyle::FormatList");
- qRegisterMetaTypeStreamOperators<FormatList>("UiStyle::FormatList");
- Q_ASSERT(QVariant::nameToType("UiStyle::FormatList") != QVariant::Invalid);
- }
+ static bool registered = []() {
+ qRegisterMetaType<FormatList>();
+ qRegisterMetaTypeStreamOperators<FormatList>();
+ return true;
+ }();
+ Q_UNUSED(registered)
_uiStylePalette = QVector<QBrush>(static_cast<int>(ColorRole::NumRoles), QBrush());
_uiStylePalette = QVector<QBrush>(static_cast<int>(ColorRole::NumRoles), QBrush());