summaryrefslogtreecommitdiff
path: root/src/imports/location/declarativeplaces
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/location/declarativeplaces')
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativecategory.cpp15
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativecategory_p.h1
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativeplace.cpp11
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativeplace_p.h1
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp10
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativeplaceicon_p.h3
6 files changed, 41 insertions, 0 deletions
diff --git a/src/imports/location/declarativeplaces/qdeclarativecategory.cpp b/src/imports/location/declarativeplaces/qdeclarativecategory.cpp
index f4b5b83c..8496f022 100644
--- a/src/imports/location/declarativeplaces/qdeclarativecategory.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativecategory.cpp
@@ -127,6 +127,16 @@ void QDeclarativeCategory::setPlugin(QDeclarativeGeoServiceProvider *plugin)
if (!m_plugin)
return;
+ if (m_plugin->isAttached()) {
+ pluginReady();
+ } else {
+ connect(m_plugin, SIGNAL(attached()),
+ this, SLOT(pluginReady()));
+ }
+}
+
+void QDeclarativeCategory::pluginReady()
+{
QGeoServiceProvider *serviceProvider = m_plugin->sharedGeoServiceProvider();
QPlaceManager *placeManager = serviceProvider->placeManager();
if (!placeManager || serviceProvider->error() != QGeoServiceProvider::NoError) {
@@ -428,6 +438,11 @@ QPlaceManager *QDeclarativeCategory::manager()
}
QGeoServiceProvider *serviceProvider = m_plugin->sharedGeoServiceProvider();
+ if (!serviceProvider) {
+ m_errorString = tr("Plugin not valid");
+ setStatus(Error);
+ return 0;
+ }
QPlaceManager *placeManager = serviceProvider->placeManager();
if (!placeManager) {
m_errorString = tr("Places not supported by %1 plugin.").arg(m_plugin->name());
diff --git a/src/imports/location/declarativeplaces/qdeclarativecategory_p.h b/src/imports/location/declarativeplaces/qdeclarativecategory_p.h
index a8ed66c1..ba3a9502 100644
--- a/src/imports/location/declarativeplaces/qdeclarativecategory_p.h
+++ b/src/imports/location/declarativeplaces/qdeclarativecategory_p.h
@@ -125,6 +125,7 @@ signals:
private slots:
void replyFinished();
+ void pluginReady();
private:
QPlaceManager *manager();
diff --git a/src/imports/location/declarativeplaces/qdeclarativeplace.cpp b/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
index 9617c8f0..e4fb3887 100644
--- a/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
@@ -230,6 +230,17 @@ void QDeclarativePlace::setPlugin(QDeclarativeGeoServiceProvider *plugin)
m_plugin = plugin;
if (m_complete)
emit pluginChanged();
+
+ if (m_plugin->isAttached()) {
+ pluginReady();
+ } else {
+ connect(m_plugin, SIGNAL(attached()),
+ this, SLOT(pluginReady()));
+ }
+}
+
+void QDeclarativePlace::pluginReady()
+{
QGeoServiceProvider *serviceProvider = m_plugin->sharedGeoServiceProvider();
QPlaceManager *placeManager = serviceProvider->placeManager();
if (!placeManager || serviceProvider->error() != QGeoServiceProvider::NoError) {
diff --git a/src/imports/location/declarativeplaces/qdeclarativeplace_p.h b/src/imports/location/declarativeplaces/qdeclarativeplace_p.h
index a6a78bc7..bc91d8ba 100644
--- a/src/imports/location/declarativeplaces/qdeclarativeplace_p.h
+++ b/src/imports/location/declarativeplaces/qdeclarativeplace_p.h
@@ -204,6 +204,7 @@ signals:
private slots:
void finished();
void contactsModified(const QString &, const QVariant &);
+ void pluginReady();
private:
void synchronizeCategories();
diff --git a/src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp b/src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp
index 043d2221..15e0c099 100644
--- a/src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp
@@ -198,6 +198,16 @@ void QDeclarativePlaceIcon::setPlugin(QDeclarativeGeoServiceProvider *plugin)
if (!m_plugin)
return;
+ if (m_plugin->isAttached()) {
+ pluginReady();
+ } else {
+ connect(m_plugin, SIGNAL(attached()),
+ this, SLOT(pluginReady()));
+ }
+}
+
+void QDeclarativePlaceIcon::pluginReady()
+{
QGeoServiceProvider *serviceProvider = m_plugin->sharedGeoServiceProvider();
QPlaceManager *placeManager = serviceProvider->placeManager();
if (!placeManager || serviceProvider->error() != QGeoServiceProvider::NoError) {
diff --git a/src/imports/location/declarativeplaces/qdeclarativeplaceicon_p.h b/src/imports/location/declarativeplaces/qdeclarativeplaceicon_p.h
index 0b3ec0d6..f06f3438 100644
--- a/src/imports/location/declarativeplaces/qdeclarativeplaceicon_p.h
+++ b/src/imports/location/declarativeplaces/qdeclarativeplaceicon_p.h
@@ -82,6 +82,9 @@ signals:
void parametersChanged(); //in practice is never emitted since parameters cannot be re-assigned
//the declaration is needed to avoid warnings about non-notifyable properties
+private Q_SLOTS:
+ void pluginReady();
+
private:
QPlaceManager *manager() const;
void initParameters(const QVariantMap &parameterMap);