Changeset View
Changeset View
Standalone View
Standalone View
dataengines/statusnotifieritem/statusnotifieritemsource.cpp
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | 73 | { | |||
---|---|---|---|---|---|
74 | setObjectName(notifierItemId); | 74 | setObjectName(notifierItemId); | ||
75 | qDBusRegisterMetaType<KDbusImageStruct>(); | 75 | qDBusRegisterMetaType<KDbusImageStruct>(); | ||
76 | qDBusRegisterMetaType<KDbusImageVector>(); | 76 | qDBusRegisterMetaType<KDbusImageVector>(); | ||
77 | qDBusRegisterMetaType<KDbusToolTipStruct>(); | 77 | qDBusRegisterMetaType<KDbusToolTipStruct>(); | ||
78 | 78 | | |||
79 | m_typeId = notifierItemId; | 79 | m_typeId = notifierItemId; | ||
80 | m_name = notifierItemId; | 80 | m_name = notifierItemId; | ||
81 | 81 | | |||
82 | //set the initial values for all the things | ||||
83 | //this is important as Plasma::DataModel has an unsolvable bug | ||||
84 | //when it gets data with a new key it tries to update the QAIM roleNames | ||||
85 | //from QML this achieves absolutely nothing as there is no signal to tell QQmlDelegateModel to reload the roleNames in QQmlAdapatorModel | ||||
broulik: Wrong indentation | |||||
There is in Phab, but there isn't on my computer... No idea why. davidedmundson: There is in Phab, but there isn't on my computer... No idea why. | |||||
86 | //no matter if the row changes or the model refreshes | ||||
87 | //this means it does not re-evaluate what bindings exist (watchedRoleIds) - and we get properties that don't bind and thus system tray icons | ||||
88 | | ||||
89 | //by setting everything up-front so that we have all role names when we call the first checkForUpdate() | ||||
90 | setData(QStringLiteral("AttentionIcon"), QIcon()); | ||||
broulik: AttentionIcon is a QIcon | |||||
91 | setData(QStringLiteral("AttentionIconName"), QString()); | ||||
92 | setData(QStringLiteral("AttentionMovieName"), QString()); | ||||
93 | setData(QStringLiteral("Category"), QString()); | ||||
94 | setData(QStringLiteral("Icon"), QIcon()); | ||||
broulik: This is also a QIcon | |||||
95 | setData(QStringLiteral("IconName"), QString()); | ||||
96 | setData(QStringLiteral("IconsChanged"), false); | ||||
97 | setData(QStringLiteral("IconThemePath"), QString()); | ||||
98 | setData(QStringLiteral("Id"), QString()); | ||||
99 | setData(QStringLiteral("ItemIsMenu"), false); | ||||
100 | setData(QStringLiteral("OverlayIconName"), QString()); | ||||
101 | setData(QStringLiteral("StatusChanged"), false); | ||||
102 | setData(QStringLiteral("Status"), QString()); | ||||
103 | setData(QStringLiteral("TitleChanged"), false); | ||||
104 | setData(QStringLiteral("Title"), QString()); | ||||
105 | setData(QStringLiteral("ToolTipChanged"), false); | ||||
106 | setData(QStringLiteral("ToolTipIcon"), QString()); | ||||
broulik: This apparently can be both QString and QIcon... | |||||
107 | setData(QStringLiteral("ToolTipSubTitle"), QString()); | ||||
108 | setData(QStringLiteral("ToolTipTitle"), QString()); | ||||
109 | setData(QStringLiteral("WindowId"), QVariant()); | ||||
110 | | ||||
82 | int slash = notifierItemId.indexOf('/'); | 111 | int slash = notifierItemId.indexOf('/'); | ||
broulik: Two superfluous empty lines | |||||
83 | if (slash == -1) { | 112 | if (slash == -1) { | ||
84 | qWarning() << "Invalid notifierItemId:" << notifierItemId; | 113 | qWarning() << "Invalid notifierItemId:" << notifierItemId; | ||
85 | m_valid = false; | 114 | m_valid = false; | ||
86 | m_statusNotifierItemInterface = 0; | 115 | m_statusNotifierItemInterface = 0; | ||
87 | return; | 116 | return; | ||
88 | } | 117 | } | ||
89 | QString service = notifierItemId.left(slash); | 118 | QString service = notifierItemId.left(slash); | ||
90 | QString path = notifierItemId.mid(slash); | 119 | QString path = notifierItemId.mid(slash); | ||
▲ Show 20 Lines • Show All 370 Lines • Show Last 20 Lines |
Wrong indentation