@@ -70,8 +70,9 @@ IndicatorsModel::IndicatorsModel(QObject *parent)
70/*! \internal */
70/*! \internal */
71IndicatorsModel::~IndicatorsModel()
71IndicatorsModel::~IndicatorsModel()
73+ disconnect(m_manager, 0, 0, 0);
74+ m_manager->deleteLater();
73− delete m_widgetsMap;
75+ m_widgetsMap->deleteLater();
@@ -155,6 +156,7 @@ void IndicatorsModel::onIndicatorLoaded(const QString& indicator)
155 QObject* obj = dynamic_cast<QObject*>(plugin.get());
156 QObject* obj = dynamic_cast<QObject*>(plugin.get());
159+ QObject::connect(obj, SIGNAL(idChanged(const QString&)), this, SLOT(onIdChanged()));
158 QObject::connect(obj, SIGNAL(iconChanged(const QUrl&)), this, SLOT(onIconChanged()));
160 QObject::connect(obj, SIGNAL(iconChanged(const QUrl&)), this, SLOT(onIconChanged()));
159 QObject::connect(obj, SIGNAL(titleChanged(const QString&)), this, SLOT(onTitleChanged()));
161 QObject::connect(obj, SIGNAL(titleChanged(const QString&)), this, SLOT(onTitleChanged()));
160 QObject::connect(obj, SIGNAL(labelChanged(const QString&)), this, SLOT(onLabelChanged()));
162 QObject::connect(obj, SIGNAL(labelChanged(const QString&)), this, SLOT(onLabelChanged()));
@@ -189,6 +191,12 @@ void IndicatorsModel::onIndicatorAboutToBeUnloaded(const QString& indicator)
195+void IndicatorsModel::onIdChanged()
197+ notifyDataChanged(QObject::sender(), Identifier);
192/*! \internal */
200/*! \internal */
193void IndicatorsModel::onIconChanged()
201void IndicatorsModel::onIconChanged()
@@ -233,6 +241,7 @@ QHash<int, QByteArray> IndicatorsModel::roleNames() const
234 static QHash<int, QByteArray> roles;
242 static QHash<int, QByteArray> roles;
235 if (roles.isEmpty()) {
243 if (roles.isEmpty()) {
244+ roles[Identifier] = "identifier";
236 roles[Title] = "title";
245 roles[Title] = "title";
237 roles[IconSource] = "iconSource";
246 roles[IconSource] = "iconSource";
238 roles[Label] = "label";
247 roles[Label] = "label";
@@ -261,6 +270,11 @@ QVariant IndicatorsModel::data(const QModelIndex &index, int role) const
261 IndicatorClientInterface::Ptr plugin = m_plugins[index.row()];
270 IndicatorClientInterface::Ptr plugin = m_plugins[index.row()];
263 switch (role) {
272 switch (role) {
275+ attribute = QVariant(plugin->identifier());
264 case Title:
278 case Title:
265 if (plugin) {
279 if (plugin) {
266 attribute = QVariant(plugin->title());
280 attribute = QVariant(plugin->title());