equal
deleted
inserted
replaced
104 : QObject(parent) |
104 : QObject(parent) |
105 { |
105 { |
106 qRegisterMetaType<HsWidgetComponentDescriptor>("HsWidgetComponentDescriptor"); |
106 qRegisterMetaType<HsWidgetComponentDescriptor>("HsWidgetComponentDescriptor"); |
107 |
107 |
108 CaQuery query; |
108 CaQuery query; |
109 query.setEntryTypeNames(QStringList(widgetTypeName())); |
109 query.setEntryTypeNames(QStringList(Hs::widgetTypeName)); |
110 CaNotifierFilter filter(query); |
110 CaNotifierFilter filter(query); |
111 CaNotifier *notifier = CaService::instance()->createNotifier(filter); |
111 CaNotifier *notifier = CaService::instance()->createNotifier(filter); |
112 notifier->setParent(this); |
112 notifier->setParent(this); |
113 connect(notifier, |
113 connect(notifier, |
114 SIGNAL(entryChanged(CaEntry,ChangeType)), |
114 SIGNAL(entryChanged(CaEntry,ChangeType)), |
141 if (component) { |
141 if (component) { |
142 component->emitUnavailable(); |
142 component->emitUnavailable(); |
143 } |
143 } |
144 } else { |
144 } else { |
145 // uninstalled |
145 // uninstalled |
146 QString rootPath = entry.attribute(widgetPathAttributeName()); |
146 QString rootPath = entry.attribute(Hs::widgetPathAttributeName); |
147 mServiceManager.removeService(uri); |
147 mServiceManager.removeService(uri); |
148 QCoreApplication::removeLibraryPath(rootPath); |
148 QCoreApplication::removeLibraryPath(rootPath); |
149 if (component) { |
149 if (component) { |
150 // for now support versions without uninstaller |
150 // for now support versions without uninstaller |
151 component->emitAboutToUninstall(); |
151 component->emitAboutToUninstall(); |
174 /*! |
174 /*! |
175 Registers widget to qt service framework and adds widget path to application's library path. |
175 Registers widget to qt service framework and adds widget path to application's library path. |
176 */ |
176 */ |
177 void HsWidgetComponentRegistry::registerService(const CaEntry &entry, const QString& uri, bool reset) |
177 void HsWidgetComponentRegistry::registerService(const CaEntry &entry, const QString& uri, bool reset) |
178 { |
178 { |
179 QString path = entry.attribute(widgetPathAttributeName()); |
179 QString path = entry.attribute(Hs::widgetPathAttributeName); |
180 QString serviceXml = entry.attribute("widget:servicexml"); |
180 QString serviceXml = entry.attribute("widget:servicexml"); |
181 if (!path.isEmpty() && !serviceXml.isEmpty()) { |
181 if (!path.isEmpty() && !serviceXml.isEmpty()) { |
182 QString service = QDir::toNativeSeparators(path + "/" + serviceXml); |
182 QString service = QDir::toNativeSeparators(path + "/" + serviceXml); |
183 // if it already exists, it's not added |
183 // if it already exists, it's not added |
184 if (reset) { |
184 if (reset) { |
192 /*! |
192 /*! |
193 Slot to handle entry changes in content service. |
193 Slot to handle entry changes in content service. |
194 */ |
194 */ |
195 void HsWidgetComponentRegistry::onEntryChanged(const CaEntry &entry, ChangeType changeType) |
195 void HsWidgetComponentRegistry::onEntryChanged(const CaEntry &entry, ChangeType changeType) |
196 { |
196 { |
197 QString uri = entry.attribute(widgetUriAttributeName()); |
197 QString uri = entry.attribute(Hs::widgetUriAttributeName); |
198 switch (changeType) { |
198 switch (changeType) { |
199 case AddChangeType: |
199 case AddChangeType: |
200 handleEntryAdded(entry,uri); |
200 handleEntryAdded(entry,uri); |
201 break; |
201 break; |
202 |
202 |