Commit 8f5687b1 authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

Properly intialize default permissions for new connections

This makes use of the new method that was added for this.
parent 5fdf4d9f
......@@ -26,6 +26,7 @@
#include "settings/wiredconnectionwidget.h"
#include "settings/wiredsecurity.h"
#include "settings/wireguardinterfacewidget.h"
#include "uiutils.h"
#include "vpnuiplugin.h"
#include <NetworkManagerQt/ActiveConnection>
......@@ -188,7 +189,7 @@ void ConnectionEditorBase::initialize()
const NetworkManager::ConnectionSettings::ConnectionType type = m_connection->connectionType();
if (emptyConnection) {
m_connection->addToPermissions(KUser().loginName(), QString());
UiUtils::setConnectionDefaultPermissions(m_connection);
}
// General configuration common to all connection types
......
......@@ -70,7 +70,6 @@ Handler::Handler(QObject *parent)
}
m_hotspotSupported = checkHotspotSupported();
m_runningLiveImage = UiUtils::isLiveImage();
if (NetworkManager::checkVersion(1, 16, 0)) {
connect(NetworkManager::notifier(), &NetworkManager::Notifier::primaryConnectionTypeChanged, this, &Handler::primaryConnectionTypeChanged);
......@@ -242,7 +241,8 @@ void Handler::addAndActivateConnection(const QString &device, const QString &spe
settings->setId(ap->ssid());
settings->setUuid(NetworkManager::ConnectionSettings::createNewUuid());
settings->setAutoconnect(true);
settings->addToPermissions(KUser().loginName(), QString());
UiUtils::setConnectionDefaultPermissions(settings);
NetworkManager::WirelessSetting::Ptr wifiSetting = settings->setting(NetworkManager::Setting::Wireless).dynamicCast<NetworkManager::WirelessSetting>();
wifiSetting->setInitialized(true);
......@@ -296,9 +296,6 @@ void Handler::addAndActivateConnection(const QString &device, const QString &spe
if (securityType == NetworkManager::StaticWep) {
wifiSecurity->setKeyMgmt(NetworkManager::WirelessSecuritySetting::Wep);
wifiSecurity->setWepKey0(password);
if (KWallet::Wallet::isEnabled() && !m_runningLiveImage) {
wifiSecurity->setWepKeyFlags(NetworkManager::Setting::AgentOwned);
}
} else {
if (ap->mode() == NetworkManager::AccessPoint::Adhoc) {
wifiSecurity->setKeyMgmt(NetworkManager::WirelessSecuritySetting::WpaNone);
......@@ -306,9 +303,6 @@ void Handler::addAndActivateConnection(const QString &device, const QString &spe
wifiSecurity->setKeyMgmt(NetworkManager::WirelessSecuritySetting::WpaPsk);
}
wifiSecurity->setPsk(password);
if (KWallet::Wallet::isEnabled() && !m_runningLiveImage) {
wifiSecurity->setPskFlags(NetworkManager::Setting::AgentOwned);
}
}
addAndActivateConnectionDBus(settings->toMap(), device, specificObject);
}
......
......@@ -132,7 +132,6 @@ private:
void addAndActivateConnectionDBus(const NMVariantMapMap &map, const QString &device, const QString &specificObject);
bool m_hotspotSupported;
bool m_runningLiveImage;
bool m_tmpWirelessEnabled;
bool m_tmpWwanEnabled;
#if WITH_MODEMMANAGER_SUPPORT
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment