Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[libconnman-qt] Set multiple VPN properties with one D-Bus call. JB#4…
…6120

Changed to use SetProperties implemented to ConnMan vpnd when modifying
the properties of a VPN connection. SetProperties accepts an a{sv} so
the marshalled QVariantMap can be used.

This improves the performance as only one D-Bus call is to be made when
a VPN properties are saved. Downside is that error on individual
property cannot be received. InvalidProperty is received only when all
properties are invalid.
  • Loading branch information
LaakkonenJussi committed Dec 3, 2019
1 parent 9459693 commit e7dc697
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 4 additions & 0 deletions libconnman-qt/connman_vpn_connection.xml
Expand Up @@ -6,6 +6,10 @@
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
<arg name="properties" type="a{sv}" direction="out"/>
</method>
<method name="SetProperties">
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
<arg name="properties" type="a{sv}" direction="in"/>
</method>
<method name="SetProperty">
<arg name="name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
Expand Down
5 changes: 1 addition & 4 deletions libconnman-qt/vpnconnection.cpp
Expand Up @@ -155,10 +155,7 @@ void VpnConnection::modifyConnection(const QVariantMap &properties)
updatedProperties.remove(QString("immutable"));
updatedProperties.remove(QString("storeCredentials"));

QVariantMap dbusProps = MarshalUtils::propertiesToDBus(updatedProperties);
for (QMap<QString, QVariant>::const_iterator i = dbusProps.constBegin(); i != dbusProps.constEnd(); ++i) {
d->m_connectionProxy.SetProperty(i.key(), QDBusVariant(i.value()));
}
d->m_connectionProxy.SetProperties(MarshalUtils::propertiesToDBus(updatedProperties));
}

void VpnConnection::activate()
Expand Down

0 comments on commit e7dc697

Please sign in to comment.