From f217a8096b3c6188dd1d1520d854f330dbb17264 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Thu, 13 Nov 2014 13:06:49 +1000 Subject: 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 Reviewed-by: Timo Jyrinki --- src/plugins/bearer/linux_common/qofonoservice_linux.cpp | 12 ++++++++++++ src/plugins/bearer/linux_common/qofonoservice_linux_p.h | 2 ++ 2 files changed, 14 insertions(+) (limited to 'src/plugins/bearer/linux_common') 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 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); }; -- cgit v1.2.3