Changeset View
Changeset View
Standalone View
Standalone View
src/core/models/tagmodel.cpp
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Line(s) | 103 | case IdRole: | |||
---|---|---|---|---|---|
104 | return tag.id(); | 104 | return tag.id(); | ||
105 | case GIDRole: | 105 | case GIDRole: | ||
106 | return tag.gid(); | 106 | return tag.gid(); | ||
107 | case ParentRole: | 107 | case ParentRole: | ||
108 | return QVariant::fromValue(tag.parent()); | 108 | return QVariant::fromValue(tag.parent()); | ||
109 | case TagRole: | 109 | case TagRole: | ||
110 | return QVariant::fromValue(tag); | 110 | return QVariant::fromValue(tag); | ||
111 | case Qt::DecorationRole: { | 111 | case Qt::DecorationRole: { | ||
112 | TagAttribute *attr = tag.attribute<TagAttribute>(); | 112 | if (const TagAttribute *attr = tag.attribute<TagAttribute>()) { | ||
113 | if (attr) { | | |||
114 | return QIcon::fromTheme(attr->iconName()); | 113 | return QIcon::fromTheme(attr->iconName()); | ||
115 | } else { | 114 | } else { | ||
116 | return QVariant(); | 115 | return QVariant(); | ||
117 | } | 116 | } | ||
118 | } | 117 | } | ||
119 | } | 118 | } | ||
120 | 119 | | |||
121 | return QVariant(); | 120 | return QVariant(); | ||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |