diff options
author | Lorn Potter <lorn.potter@gmail.com> | 2014-11-13 13:06:49 +1000 |
---|---|---|
committer | Lorn Potter <lorn.potter@gmail.com> | 2014-11-20 20:45:13 +0100 |
commit | f217a8096b3c6188dd1d1520d854f330dbb17264 (patch) | |
tree | 024b22aeda47911503e44e84e4e1df1af8e23525 /src/plugins/bearer/linux_common | |
parent | f20af07e82f010273fd68b0545467c495e3c64f9 (diff) |
QtBearer networkmanager make sure to set flag Active
Also, no need to create objects to get properties, when the properties
can be had for free.
Make plugin more robust to network-manager or ofono crashes
Change-Id: Ibadb46bd51aa27f130f8d245e8c50aa7bff5f9c8
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Reviewed-by: Timo Jyrinki <timo.jyrinki@canonical.com>
Diffstat (limited to 'src/plugins/bearer/linux_common')
-rw-r--r-- | src/plugins/bearer/linux_common/qofonoservice_linux.cpp | 12 | ||||
-rw-r--r-- | src/plugins/bearer/linux_common/qofonoservice_linux_p.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/bearer/linux_common/qofonoservice_linux.cpp b/src/plugins/bearer/linux_common/qofonoservice_linux.cpp index b2e2131a92..abbfd445a5 100644 --- a/src/plugins/bearer/linux_common/qofonoservice_linux.cpp +++ b/src/plugins/bearer/linux_common/qofonoservice_linux.cpp @@ -269,6 +269,18 @@ QStringList QOfonoDataConnectionManagerInterface::contexts() return contextList; } +PathPropertiesList QOfonoDataConnectionManagerInterface::contextsWithProperties() +{ + if (contextListProperties.isEmpty()) { + QDBusPendingReply<PathPropertiesList > reply = call(QLatin1String("GetContexts")); + reply.waitForFinished(); + if (!reply.isError()) { + contextListProperties = reply.value(); + } + } + return contextListProperties; +} + bool QOfonoDataConnectionManagerInterface::roamingAllowed() { QVariant var = getProperty(QStringLiteral("RoamingAllowed")); diff --git a/src/plugins/bearer/linux_common/qofonoservice_linux_p.h b/src/plugins/bearer/linux_common/qofonoservice_linux_p.h index 0ed00d94ff..3b97e06dd3 100644 --- a/src/plugins/bearer/linux_common/qofonoservice_linux_p.h +++ b/src/plugins/bearer/linux_common/qofonoservice_linux_p.h @@ -153,6 +153,7 @@ public: ~QOfonoDataConnectionManagerInterface(); QStringList contexts(); + PathPropertiesList contextsWithProperties(); bool roamingAllowed(); QVariant getProperty(const QString &); QString bearer(); @@ -162,6 +163,7 @@ private: QVariantMap getProperties(); QVariantMap propertiesMap; QStringList contextList; + PathPropertiesList contextListProperties; private slots: void propertyChanged(const QString &, const QDBusVariant &value); }; |