Skip to content

Commit

Permalink
[systemsettings] Disable autoconnect before removing VPN. Contributes…
Browse files Browse the repository at this point in the history
… to JB#42797

This fixes the issue of removing a connected VPN from the list. It is
imperative to set the autoconnect flag false, then disconnect and after
that remove the VPN. This happens because ConnMan will try to reconnect
the VPN, fails in connecting and then saves the state of the VPN,
recreating configuration files of the deleted VPN if it is only
disconnected before removing it.
  • Loading branch information
LaakkonenJussi committed Sep 4, 2018
1 parent 293ae72 commit 06e4661
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/vpnmodel.cpp
Expand Up @@ -488,6 +488,7 @@ void VpnModel::deleteConnection(const QString &path)
if (conn->state() == VpnModel::Ready || conn->state() == VpnModel::Configuration) {
ConnmanServiceProxy* proxy = vpnServices_.value(path);
if (proxy) {
proxy->SetProperty(autoConnectKey, QDBusVariant(false));
QDBusPendingCall call = proxy->Disconnect();
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(call, this);
connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, path](QDBusPendingCallWatcher *watcher) {
Expand Down

0 comments on commit 06e4661

Please sign in to comment.