@@ -19,7 +19,6 @@
20#include "indicatorsmodel.h"
20#include "indicatorsmodel.h"
21#include "indicatorsmanager.h"
21#include "indicatorsmanager.h"
22−#include "widgetsmap.h"
23#include "indicatorclientinterface.h"
22#include "indicatorclientinterface.h"
25#include <QQmlContext>
24#include <QQmlContext>
@@ -60,7 +59,6 @@ IndicatorsModel::IndicatorsModel(QObject *parent)
60 m_manager = new IndicatorsManager(this);
59 m_manager = new IndicatorsManager(this);
61 QObject::connect(m_manager, SIGNAL(indicatorLoaded(const QString&)), this, SLOT(onIndicatorLoaded(const QString&)));
60 QObject::connect(m_manager, SIGNAL(indicatorLoaded(const QString&)), this, SLOT(onIndicatorLoaded(const QString&)));
62 QObject::connect(m_manager, SIGNAL(indicatorAboutToBeUnloaded(const QString&)), this, SLOT(onIndicatorAboutToBeUnloaded(const QString&)));
61 QObject::connect(m_manager, SIGNAL(indicatorAboutToBeUnloaded(const QString&)), this, SLOT(onIndicatorAboutToBeUnloaded(const QString&)));
63− m_widgetsMap = new WidgetsMap;
65 QObject::connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
63 QObject::connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
66 QObject::connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
64 QObject::connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
@@ -72,7 +70,6 @@ IndicatorsModel::~IndicatorsModel()
73 disconnect(m_manager, 0, 0, 0);
71 disconnect(m_manager, 0, 0, 0);
74 m_manager->deleteLater();
72 m_manager->deleteLater();
75− m_widgetsMap->deleteLater();
@@ -107,15 +104,6 @@ int IndicatorsModel::count() const
107 return rowCount();
104 return rowCount();
111− \qmlproperty WidgetsMap IndicatorsModel::widgetsMap
112− This property holds the map for all new widgets registered by dynamically loaded plugins.
114−WidgetsMap* IndicatorsModel::widgetsMap() const
116− return m_widgetsMap;
120 \qmlmethod IndicatorsModel::unload()
108 \qmlmethod IndicatorsModel::unload()
@@ -123,7 +111,6 @@ WidgetsMap* IndicatorsModel::widgetsMap() const
124void IndicatorsModel::load()
112void IndicatorsModel::load()
126− m_widgetsMap->clear();
127 m_plugins.clear();
114 m_plugins.clear();
128 m_manager->load();
115 m_manager->load();
@@ -135,7 +122,6 @@ void IndicatorsModel::load()
136void IndicatorsModel::unload()
123void IndicatorsModel::unload()
138− m_widgetsMap->clear();
139 m_manager->unload();
125 m_manager->unload();
@@ -151,8 +137,6 @@ void IndicatorsModel::onIndicatorLoaded(const QString& indicator)
152 beginInsertRows(QModelIndex(), insert_pos, insert_pos);
138 beginInsertRows(QModelIndex(), insert_pos, insert_pos);
154− m_widgetsMap->append(plugin->widgets());
156 QObject* obj = dynamic_cast<QObject*>(plugin.get());
140 QObject* obj = dynamic_cast<QObject*>(plugin.get());
@@ -165,8 +149,6 @@ void IndicatorsModel::onIndicatorLoaded(const QString& indicator)
165 m_plugins.insert(i, plugin);
149 m_plugins.insert(i, plugin);
167 endInsertRows();
151 endInsertRows();
169− Q_EMIT widgetsMapChanged(m_widgetsMap);
172/*! \internal */
154/*! \internal */
@@ -301,10 +283,7 @@ QVariant IndicatorsModel::data(const QModelIndex &index, int role) const
302 case QMLComponent:
284 case QMLComponent:
303 if (plugin) {
285 if (plugin) {
304− QQmlContext *context = QQmlEngine::contextForObject(this);
286+ return plugin->componentSource();
306− attribute = QVariant::fromValue<QQmlComponent*>(plugin->component(context->parentContext()->engine()));
310 case InitialProperties:
289 case InitialProperties: