@@ -20,6 +20,7 @@
20#include "indicatorsmodel.h"
20#include "indicatorsmodel.h"
21#include "indicatorsmanager.h"
21#include "indicatorsmanager.h"
22#include "indicator.h"
22#include "indicator.h"
23+#include "indicators.h"
23#include "paths.h"
24#include "paths.h"
25#include <QQmlContext>
26#include <QQmlContext>
@@ -118,7 +119,7 @@ void IndicatorsModel::onIndicatorLoaded(const QString& indicator_name)
118 while (pos < count())
119 while (pos < count())
120 // keep going while the existing priority is less.
121 // keep going while the existing priority is less.
121− if (indicatorData(indicator, Priority).toInt() < data(index(pos), Priority).toInt())
122+ if (indicatorData(indicator, IndicatorsModelRole::Priority).toInt() < data(index(pos), IndicatorsModelRole::Priority).toInt())
@@ -160,13 +161,13 @@ void IndicatorsModel::onIndicatorAboutToBeUnloaded(const QString& indicator_name
160/*! \internal */
161/*! \internal */
161void IndicatorsModel::onIdentifierChanged()
162void IndicatorsModel::onIdentifierChanged()
163− notifyDataChanged(QObject::sender(), Identifier);
164+ notifyDataChanged(QObject::sender(), IndicatorsModelRole::Identifier);
166/*! \internal */
167/*! \internal */
167void IndicatorsModel::onIndicatorPropertiesChanged()
168void IndicatorsModel::onIndicatorPropertiesChanged()
169− notifyDataChanged(QObject::sender(), IndicatorProperties);
170+ notifyDataChanged(QObject::sender(), IndicatorsModelRole::IndicatorProperties);
172/*! \internal */
173/*! \internal */
@@ -198,14 +199,14 @@ QHash<int, QByteArray> IndicatorsModel::roleNames() const
198 static QHash<int, QByteArray> roles;
199 static QHash<int, QByteArray> roles;
199 if (roles.isEmpty())
200 if (roles.isEmpty())
201− roles[Identifier] = "identifier";
202+ roles[IndicatorsModelRole::Identifier] = "identifier";
202− roles[Priority] = "priority";
203+ roles[IndicatorsModelRole::Priority] = "priority";
203− roles[Title] = "title";
204+ roles[IndicatorsModelRole::Title] = "title";
204− roles[Description] = "description";
205+ roles[IndicatorsModelRole::Description] = "description";
205− roles[WidgetSource] = "widgetSource";
206+ roles[IndicatorsModelRole::WidgetSource] = "widgetSource";
206− roles[PageSource] = "pageSource";
207+ roles[IndicatorsModelRole::PageSource] = "pageSource";
207− roles[IndicatorProperties] = "indicatorProperties";
208+ roles[IndicatorsModelRole::IndicatorProperties] = "indicatorProperties";
208− roles[IsValid] = "isValid";
209+ roles[IndicatorsModelRole::IsValid] = "isValid";
210 return roles;
211 return roles;
@@ -221,15 +222,15 @@ QVariant IndicatorsModel::defaultData(Indicator::Ptr indicator, int role)
222 switch (role)
223 switch (role)
224− case Priority:
225+ case IndicatorsModelRole::Priority:
225 return 0;
226 return 0;
226− case Title:
227+ case IndicatorsModelRole::Title:
227 return indicator ? indicator->identifier() : "Unknown";
228 return indicator ? indicator->identifier() : "Unknown";
228− case Description:
229+ case IndicatorsModelRole::Description:
229 return "";
230 return "";
230− case WidgetSource:
231+ case IndicatorsModelRole::WidgetSource:
231 return shellAppDirectory()+"/Panel/Indicators/DefaultIndicatorWidget.qml";
232 return shellAppDirectory()+"/Panel/Indicators/DefaultIndicatorWidget.qml";
232− case PageSource:
233+ case IndicatorsModelRole::PageSource:
233 return shellAppDirectory()+"/Panel/Indicators/DefaultIndicatorPage.qml";
234 return shellAppDirectory()+"/Panel/Indicators/DefaultIndicatorPage.qml";
235 return QVariant();
236 return QVariant();
@@ -250,25 +251,25 @@ QVariant IndicatorsModel::data(const QModelIndex &index, int role) const
251 switch (role)
252 switch (role)
253− case Identifier:
254+ case IndicatorsModelRole::Identifier:
254 if (indicator)
255 if (indicator)
256 return QVariant(indicator->identifier());
257 return QVariant(indicator->identifier());
259− case IndicatorProperties:
260+ case IndicatorsModelRole::IndicatorProperties:
260 if (indicator)
261 if (indicator)
262 return QVariant(indicator->indicatorProperties());
263 return QVariant(indicator->indicatorProperties());
265− case IsValid:
266+ case IndicatorsModelRole::IsValid:
266 return (indicator ? true : false);
267 return (indicator ? true : false);
267− case Priority:
268+ case IndicatorsModelRole::Priority:
268− case Title:
269+ case IndicatorsModelRole::Title:
269− case Description:
270+ case IndicatorsModelRole::Description:
270− case WidgetSource:
271+ case IndicatorsModelRole::WidgetSource:
271− case PageSource:
272+ case IndicatorsModelRole::PageSource:
272 return indicatorData(indicator, role);
273 return indicatorData(indicator, role);