[kde-plasma-nm] Pickup upstream fixes Do not make git snaphots, but just include upstream patches Resolves: bz#11547
Jan Grulich
jgrulich at fedoraproject.org
Mon Oct 27 12:31:37 UTC 2014
commit 3184952abbd3fa2b66654862bb741b225bab1849
Author: Jan Grulich <jgrulich at redhat.com>
Date: Mon Oct 27 13:31:34 2014 +0100
Pickup upstream fixes
Do not make git snaphots, but just include upstream patches
Resolves: bz#115476
kde-plasma-nm.spec | 54 +++-
plasma-nm-add-ipv6-tab-for-openvpn.patch | 38 ++
...d-module-registration-when-initializating.patch | 84 ++++
...heir-certificates-under-kde-configuration.patch | 102 +++++
...ck-download-upload-from-dataengine-in-qml.patch | 433 ++++++++++++++++++++
plasma-nm-connect-to-the-correct-signal.patch | 13 +
...ications-and-secret-agent-initializations.patch | 125 ++++++
...available-icon-when-there-is-available-ap.patch | 15 +
...not-ask-for-8021x-secrets-when-using-LEAP.patch | 14 +
plasma-nm-do-not-insert-empty-vpn-banner.patch | 13 +
...rying-to-open-kwallet-if-we-failed-before.patch | 60 +++
...s-as-agent-owned-when-not-running-kwallet.patch | 33 ++
...e-protected-icon-when-security-is-unknown.patch | 30 ++
plasma-nm-fix-request-scan-reply-handling.patch | 12 +
plasma-nm-prevent-error.patch | 15 +
...ecrets-supposed-to-be-merged-with-secrets.patch | 24 ++
...m-re-save-migrate-secrets-stored-in-files.patch | 115 ++++++
plasma-nm-remove-shebang-from-desktop-file.patch | 9 +
plasma-nm-replace-qt5-stuff.patch | 40 ++
plasma-nm-request-secrets-only-when-needed.patch | 234 +++++++++++
...con-even-after-small-signal-drop-increase.patch | 76 ++++
plasma-nm-use-proper-kded-service-name.patch | 13 +
plasma-nm-watch-for-ipinterface-change.patch | 54 +++
sources | 2 +-
24 files changed, 1606 insertions(+), 2 deletions(-)
---
diff --git a/kde-plasma-nm.spec b/kde-plasma-nm.spec
index 3a54290..d8b7ce6 100644
--- a/kde-plasma-nm.spec
+++ b/kde-plasma-nm.spec
@@ -1,7 +1,7 @@
%global git_commit f2ca6ae
Name: kde-plasma-nm
Version: 0.9.3.4
-Release: 14.20140916git%{git_commit}%{?dist}
+Release: 15%{git_commit}%{?dist}
Summary: Plasma applet written in QML for managing network connections
License: LGPLv2+ and GPLv2+
URL: https://projects.kde.org/projects/playground/network/plasma-nm
@@ -12,6 +12,30 @@ Source0: plasma-nm-%{version}.tar.xz
# Add plasma-nm to default systray if needed, for upgraders...
Source10: 01-fedora-plasma-nm.js
+# Upstream patches
+Patch0: plasma-nm-fix-request-scan-reply-handling.patch
+Patch1: plasma-nm-do-not-mark-secrets-as-agent-owned-when-not-running-kwallet.patch
+Patch2: plasma-nm-display-wifi-available-icon-when-there-is-available-ap.patch
+Patch3: plasma-nm-do-not-use-protected-icon-when-security-is-unknown.patch
+Patch4: plasma-nm-re-save-migrate-secrets-stored-in-files.patch
+Patch5: plasma-nm-delay-notifications-and-secret-agent-initializations.patch
+Patch6: plasma-nm-use-proper-kded-service-name.patch
+Patch7: plasma-nm-replace-qt5-stuff.patch
+Patch8: plasma-nm-also-watch-for-kded-module-registration-when-initializating.patch
+Patch9: plasma-nm-prevent-error.patch
+Patch10: plasma-nm-do-not-keep-trying-to-open-kwallet-if-we-failed-before.patch
+Patch11: plasma-nm-add-ipv6-tab-for-openvpn.patch
+Patch12: plasma-nm-remove-shebang-from-desktop-file.patch
+Patch13: plasma-nm-check-download-upload-from-dataengine-in-qml.patch
+Patch14: plasma-nm-connect-to-the-correct-signal.patch
+Patch15: plasma-nm-do-not-insert-empty-vpn-banner.patch
+Patch16: plasma-nm-update-tray-icon-even-after-small-signal-drop-increase.patch
+Patch17: plasma-nm-request-secrets-only-when-needed.patch
+Patch18: plasma-nm-ask-users-if-they-want-to-copy-their-certificates-under-kde-configuration.patch
+Patch19: plasma-nm-do-not-ask-for-8021x-secrets-when-using-LEAP.patch
+Patch20: plasma-nm-prevent-from-crash-when-requesting-secrets-supposed-to-be-merged-with-secrets.patch
+Patch21: plasma-nm-watch-for-ipinterface-change.patch
+
BuildRequires: gettext
BuildRequires: kdelibs4-devel
BuildRequires: kde-workspace-devel
@@ -115,6 +139,29 @@ Provides: kde-plasma-networkmanagement-pptp = 1:%{version}-%{release}
%prep
%setup -qn plasma-nm-%{version}
+%patch0 -p1 -b .fix-request-scan-reply-handling
+%patch1 -p1 -b .do-not-mark-secrets-as-agent-owned-when-not-running-kwallet
+%patch2 -p1 -b .display-wifi-available-icon-when-there-is-available-ap
+%patch3 -p1 -b .do-not-use-protected-icon-when-security-is-unknown
+%patch4 -p1 -b .re-save-migrate-secrets-stored-in-files
+%patch5 -p1 -b .delay-notifications-and-secret-agent-initializations
+%patch6 -p1 -b .use-proper-kded-service-name
+%patch7 -p1 -b .replace-qt5-stuff
+%patch8 -p1 -b .also-watch-for-kded-module-registration-when-initializating
+%patch9 -p1 -b .prevent-error
+%patch10 -p1 -b .do-not-keep-trying-to-open-kwallet-if-we-failed-before
+%patch11 -p1 -b .add-ipv6-tab-for-openvpn
+%patch12 -p1 -b .remove-shebang-from-desktop-file
+%patch13 -p1 -b .check-download-upload-from-dataengine-in-qml
+%patch14 -p1 -b .connect-to-the-correct-signal
+%patch15 -p1 -b .do-not-insert-empty-vpn-banner
+%patch16 -p1 -b .update-tray-icon-even-after-small-signal-drop-increase
+%patch17 -p1 -b .request-secrets-only-when-needed
+%patch18 -p1 -b .ask-users-if-they-want-to-copy-their-certificates-under-kde-configuration
+%patch19 -p1 -b .do-not-ask-for-8021x-secrets-when-using-LEAP
+%patch20 -p1 -b .prevent-from-crash-when-requesting-secrets-supposed-to-be-merged-with-secrets
+%patch21 -p1 -b .watch-for-ipinterface-change
+
%build
mkdir -p %{_target_platform}
pushd %{_target_platform}
@@ -231,6 +278,11 @@ fi
%endif
%changelog
+* Tue Sep 16 2014 Jan Grulich <jgrulich at redhat.com> - 0.9.3.4-15
+- Pickup upstream fixes
+ Do not make git snapshots, but just include upstream patches
+ Resolves: bz#1156476
+
* Tue Sep 16 2014 Jan Grulich <jgrulich at redhat.com> - 0.9.3.4-14.20140916gitf2ca6ae
- Update to the latest git snapshot including bugfixes
Resolves: bz#1133233
diff --git a/plasma-nm-add-ipv6-tab-for-openvpn.patch b/plasma-nm-add-ipv6-tab-for-openvpn.patch
new file mode 100644
index 0000000..5eddaf5
--- /dev/null
+++ b/plasma-nm-add-ipv6-tab-for-openvpn.patch
@@ -0,0 +1,38 @@
+diff --git a/libs/editor/connectiondetaileditor.cpp b/libs/editor/connectiondetaileditor.cpp
+index 066fccc..f626ec3 100644
+--- a/libs/editor/connectiondetaileditor.cpp
++++ b/libs/editor/connectiondetaileditor.cpp
+@@ -40,6 +40,7 @@
+ #include "settings/vlanwidget.h"
+ #include "settings/wimaxwidget.h"
+ #include "vpnuiplugin.h"
++#include "vpn/openvpn/nm-openvpn-service.h"
+
+ #include <QDebug>
+
+@@ -269,6 +270,7 @@ void ConnectionDetailEditor::initTabs()
+ const NetworkManager::ConnectionSettings::ConnectionType type = m_connection->connectionType();
+
+ // setup the widget tabs
++ QString serviceType;
+ if (type == NetworkManager::ConnectionSettings::Wired) {
+ WiredConnectionWidget * wiredWidget = new WiredConnectionWidget(m_connection->setting(NetworkManager::Setting::Wired), this);
+ m_ui->tabWidget->addTab(wiredWidget, i18n("Wired"));
+@@ -325,7 +327,6 @@ void ConnectionDetailEditor::initTabs()
+ if (!vpnSetting) {
+ qDebug() << "Missing VPN setting!";
+ } else {
+- QString serviceType;
+ if (m_new && !m_vpnType.isEmpty()) {
+ serviceType = m_vpnType;
+ vpnSetting->setServiceType(serviceType);
+@@ -366,7 +367,8 @@ void ConnectionDetailEditor::initTabs()
+ || type == ConnectionSettings::Wimax
+ || type == ConnectionSettings::Bond
+ || type == ConnectionSettings::Bridge
+- || type == ConnectionSettings::Vlan) && !isSlave()) {
++ || type == ConnectionSettings::Vlan
++ || (type == ConnectionSettings::Vpn && serviceType == QLatin1String(NM_DBUS_SERVICE_OPENVPN))) && !isSlave()) {
+ IPv6Widget * ipv6Widget = new IPv6Widget(m_connection->setting(NetworkManager::Setting::Ipv6), this);
+ m_ui->tabWidget->addTab(ipv6Widget, i18n("IPv6"));
+ }
diff --git a/plasma-nm-also-watch-for-kded-module-registration-when-initializating.patch b/plasma-nm-also-watch-for-kded-module-registration-when-initializating.patch
new file mode 100644
index 0000000..a8dd711
--- /dev/null
+++ b/plasma-nm-also-watch-for-kded-module-registration-when-initializating.patch
@@ -0,0 +1,84 @@
+diff --git a/kded/service.cpp b/kded/service.cpp
+index 3d30e1f..0e724ad 100644
+--- a/kded/service.cpp
++++ b/kded/service.cpp
+@@ -64,6 +64,8 @@ NetworkManagementService::NetworkManagementService(QObject * parent, const QVari
+ d->modemMonitor = 0;
+ #endif
+ d->bluetoothMonitor = 0;
++
++ connect(this, SIGNAL(slotRegistered(QDBusObjectPath)), this, SLOT(slotRegistered(QDBusObjectPath)));
+ }
+
+ NetworkManagementService::~NetworkManagementService()
+@@ -93,3 +95,11 @@ void NetworkManagementService::init()
+ d->bluetoothMonitor = new BluetoothMonitor(this);
+ }
+ }
++void NetworkManagementService::slotRegistered(const QDBusObjectPath &path)
++{
++ if (path.path() == QLatin1String("/modules/networkmanagement")) {
++ Q_EMIT registered();
++ }
++}
++
++#include "service.moc"
+diff --git a/kded/service.h b/kded/service.h
+index 08d90fd..57d99c9 100644
+--- a/kded/service.h
++++ b/kded/service.h
+@@ -45,8 +45,14 @@ public:
+ public Q_SLOTS:
+ Q_SCRIPTABLE void init();
+
++Q_SIGNALS:
++ Q_SCRIPTABLE void registered();
++
++private Q_SLOTS:
++ void slotRegistered(const QDBusObjectPath &path);
++
+ private:
+- NetworkManagementServicePrivate * d_ptr;
++ NetworkManagementServicePrivate * const d_ptr;
+ };
+
+ #endif // PLASMANM_KDED_SERVICE_H
+diff --git a/libs/handler.cpp b/libs/handler.cpp
+index 7a31787..cecf38e 100644
+--- a/libs/handler.cpp
++++ b/libs/handler.cpp
+@@ -56,7 +56,9 @@ Handler::Handler(QObject* parent)
+ , m_agentIface(QLatin1String("org.kde.kded"), QLatin1String("/modules/networkmanagement"),
+ QLatin1String("org.kde.plasmanetworkmanagement"))
+ {
+- m_agentIface.call(QLatin1String("init"));
++ initKdedModule();
++ QDBusConnection::sessionBus().connect(m_agentIface.service(), m_agentIface.path(), m_agentIface.interface(), QLatin1String("registered"),
++ this, SLOT(initKdedModule()));
+ }
+
+ Handler::~Handler()
+@@ -370,6 +372,11 @@ void Handler::editDialogAccepted()
+ }
+ }
+
++void Handler::initKdedModule()
++{
++ m_agentIface.call(QLatin1String("init"));
++}
++
+ void Handler::replyFinished(QDBusPendingCallWatcher * watcher)
+ {
+ QDBusPendingReply<> reply = *watcher;
+diff --git a/libs/handler.h b/libs/handler.h
+index d614e82..fc7a81b 100644
+--- a/libs/handler.h
++++ b/libs/handler.h
+@@ -99,6 +99,7 @@ public Q_SLOTS:
+
+ private Q_SLOTS:
+ void editDialogAccepted();
++ void initKdedModule();
+ void replyFinished(QDBusPendingCallWatcher * watcher);
+
+ private:
diff --git a/plasma-nm-ask-users-if-they-want-to-copy-their-certificates-under-kde-configuration.patch b/plasma-nm-ask-users-if-they-want-to-copy-their-certificates-under-kde-configuration.patch
new file mode 100644
index 0000000..bf31a26
--- /dev/null
+++ b/plasma-nm-ask-users-if-they-want-to-copy-their-certificates-under-kde-configuration.patch
@@ -0,0 +1,102 @@
+diff --git a/vpn/openvpn/openvpn.cpp b/vpn/openvpn/openvpn.cpp
+index e83d148..6e28d9c 100644
+--- a/vpn/openvpn/openvpn.cpp
++++ b/vpn/openvpn/openvpn.cpp
+@@ -185,6 +185,15 @@ NMVariantMapMap OpenVpnUiPlugin::importConnectionSettings(const QString &fileNam
+ return result;
+ }
+
++ bool copyCertificates;
++ KMessageBox::ButtonCode buttonCode;
++ if (KMessageBox::shouldBeShownYesNo(QLatin1String("copyCertificatesDialog"), buttonCode)) {
++ copyCertificates = KMessageBox::questionYesNo(0, i18n("Do you want to copy your certificates to %1?", KStandardDirs::locateLocal("data", "networkmanagement/certificates/")),
++ i18n("Copy certificates"), KStandardGuiItem::yes(), KStandardGuiItem::no(), QLatin1String("copyCertificatesDialog")) == KMessageBox::Yes;
++ } else {
++ copyCertificates = buttonCode == KMessageBox::Yes;
++ }
++
+ const QString connectionName = QFileInfo(fileName).completeBaseName();
+ NMStringMap dataMap;
+ NMStringMap secretData;
+@@ -391,26 +400,42 @@ NMVariantMapMap OpenVpnUiPlugin::importConnectionSettings(const QString &fileNam
+ }
+ if (key_value[0] == CA_TAG && key_value.count() > 1) {
+ key_value[1] = line.right(line.length() - line.indexOf(QRegExp("\\s"))); // Get whole string after key
+- const QString absoluteFilePath = tryToCopyToCertificatesDirectory(connectionName, unQuote(key_value[1], fileName));
+- dataMap.insert(QLatin1String(NM_OPENVPN_KEY_CA), absoluteFilePath);
++ if (copyCertificates) {
++ const QString absoluteFilePath = tryToCopyToCertificatesDirectory(connectionName, unQuote(key_value[1], fileName));
++ dataMap.insert(QLatin1String(NM_OPENVPN_KEY_CA), absoluteFilePath);
++ } else {
++ dataMap.insert(QLatin1String(NM_OPENVPN_KEY_CA), unQuote(key_value[1], fileName));
++ }
+ continue;
+ }
+ if (key_value[0] == CERT_TAG && key_value.count() > 1) {
+ key_value[1] = line.right(line.length() - line.indexOf(QRegExp("\\s"))); // Get whole string after key
+- const QString absoluteFilePath = tryToCopyToCertificatesDirectory(connectionName, unQuote(key_value[1], fileName));
+- dataMap.insert(QLatin1String(NM_OPENVPN_KEY_CERT), absoluteFilePath);
++ if (copyCertificates) {
++ const QString absoluteFilePath = tryToCopyToCertificatesDirectory(connectionName, unQuote(key_value[1], fileName));
++ dataMap.insert(QLatin1String(NM_OPENVPN_KEY_CERT), absoluteFilePath);
++ } else {
++ dataMap.insert(QLatin1String(NM_OPENVPN_KEY_CERT), unQuote(key_value[1], fileName));
++ }
+ continue;
+ }
+ if (key_value[0] == KEY_TAG && key_value.count() > 1) {
+ key_value[1] = line.right(line.length() - line.indexOf(QRegExp("\\s"))); // Get whole string after key
+- const QString absoluteFilePath = tryToCopyToCertificatesDirectory(connectionName, unQuote(key_value[1], fileName));
+- dataMap.insert(QLatin1String(NM_OPENVPN_KEY_KEY), absoluteFilePath);
++ if (copyCertificates) {
++ const QString absoluteFilePath = tryToCopyToCertificatesDirectory(connectionName, unQuote(key_value[1], fileName));
++ dataMap.insert(QLatin1String(NM_OPENVPN_KEY_KEY), absoluteFilePath);
++ } else {
++ dataMap.insert(QLatin1String(NM_OPENVPN_KEY_KEY), unQuote(key_value[1], fileName));
++ }
+ continue;
+ }
+ if (key_value[0] == SECRET_TAG && key_value.count() > 1) {
+ key_value[1] = line.right(line.length() - line.indexOf(QRegExp("\\s"))); // Get whole string after key
+- const QString absoluteFilePath = tryToCopyToCertificatesDirectory(connectionName, unQuote(key_value[1], fileName));
+- dataMap.insert(QLatin1String(NM_OPENVPN_KEY_STATIC_KEY), absoluteFilePath);
++ if (copyCertificates) {
++ const QString absoluteFilePath = tryToCopyToCertificatesDirectory(connectionName, unQuote(key_value[1], fileName));
++ dataMap.insert(QLatin1String(NM_OPENVPN_KEY_STATIC_KEY), absoluteFilePath);
++ } else {
++ dataMap.insert(QLatin1String(NM_OPENVPN_KEY_STATIC_KEY), unQuote(key_value[1], fileName));
++ }
+ if (key_value.count() > 2) {
+ key_value[2] = key_value[1];
+ if (!key_value[2].isEmpty() && (key_value[2].toLong() == 0 ||key_value[2].toLong() == 1))
+@@ -421,8 +446,12 @@ NMVariantMapMap OpenVpnUiPlugin::importConnectionSettings(const QString &fileNam
+ }
+ if (key_value[0] == TLS_AUTH_TAG && key_value.count() >1) {
+ key_value[1] = line.right(line.length() - line.indexOf(QRegExp("\\s"))); // Get whole string after key
+- const QString absoluteFilePath = tryToCopyToCertificatesDirectory(connectionName, unQuote(key_value[1], fileName));
+- dataMap.insert(QLatin1String(NM_OPENVPN_KEY_TA), absoluteFilePath);
++ if (copyCertificates) {
++ const QString absoluteFilePath = tryToCopyToCertificatesDirectory(connectionName, unQuote(key_value[1], fileName));
++ dataMap.insert(QLatin1String(NM_OPENVPN_KEY_TA), absoluteFilePath);
++ } else {
++ dataMap.insert(QLatin1String(NM_OPENVPN_KEY_TA), unQuote(key_value[1], fileName));
++ }
+ if (key_value.count() > 2) {
+ key_value[2] = key_value[1];
+ if (!key_value[2].isEmpty() && (key_value[2].toLong() == 0 ||key_value[2].toLong() == 1))
+@@ -634,12 +663,13 @@ QString OpenVpnUiPlugin::saveFile(QTextStream &in, const QString &endTag, const
+ QString OpenVpnUiPlugin::tryToCopyToCertificatesDirectory(const QString &connectionName, const QString &sourceFilePath)
+ {
+ const QString certificatesDirectory = KStandardDirs::locateLocal("data", "networkmanagement/certificates/");
+- const QString absoluteFilePath = certificatesDirectory + connectionName + '_' + QFileInfo(sourceFilePath).completeBaseName();
++ const QString absoluteFilePath = certificatesDirectory + connectionName + '_' + QFileInfo(sourceFilePath).fileName();
++
+ QFile sourceFile(sourceFilePath);
+
+ QDir().mkpath(certificatesDirectory);
+ if (!sourceFile.copy(absoluteFilePath)) {
+- KMessageBox::information(0, i18n("Error copying file to %1: %2", absoluteFilePath, sourceFile.errorString()));
++ KMessageBox::information(0, i18n("Error copying certificate to %1: %2", absoluteFilePath, sourceFile.errorString()));
+ return sourceFilePath;
+ }
+
diff --git a/plasma-nm-check-download-upload-from-dataengine-in-qml.patch b/plasma-nm-check-download-upload-from-dataengine-in-qml.patch
new file mode 100644
index 0000000..c4e05e7
--- /dev/null
+++ b/plasma-nm-check-download-upload-from-dataengine-in-qml.patch
@@ -0,0 +1,433 @@
+diff --git a/applet/declarative/contents/ui/ConnectionItem.qml b/applet/declarative/contents/ui/ConnectionItem.qml
+index 72a93d2..481c158 100644
+--- a/applet/declarative/contents/ui/ConnectionItem.qml
++++ b/applet/declarative/contents/ui/ConnectionItem.qml
+@@ -21,24 +21,31 @@
+ import QtQuick 1.1
+ import org.kde.plasma.components 0.1 as PlasmaComponents
+ import org.kde.plasma.core 0.1 as PlasmaCore
++import org.kde.locale 0.1 as KLocale
+ import org.kde.networkmanagement 0.1 as PlasmaNM
+
+-
+ ListItem {
+ id: connectionItem;
+
++ property int baseHeight: connectionItemBase.height + Math.round(units.gridUnit / 3);
+ property bool expanded: visibleDetails || visiblePasswordDialog;
+- property bool visibleDetails: false;
+- property bool visiblePasswordDialog: false;
+ property bool predictableWirelessPassword: !Uuid && Type == PlasmaNM.Enums.Wireless &&
+ (SecurityType == PlasmaNM.Enums.StaticWep || SecurityType == PlasmaNM.Enums.WpaPsk ||
+ SecurityType == PlasmaNM.Enums.Wpa2Psk);
+-
+- property int baseHeight: connectionItemBase.height + Math.round(units.gridUnit / 3);
++ property bool showSpeed: ConnectionState == PlasmaNM.Enums.Activated &&
++ (Type == PlasmaNM.Enums.Wimax ||
++ Type == PlasmaNM.Enums.Wired ||
++ Type == PlasmaNM.Enums.Wireless ||
++ Type == PlasmaNM.Enums.Gsm ||
++ Type == PlasmaNM.Enums.Cdma);
++ property bool visibleDetails: false;
++ property bool visiblePasswordDialog: false;
+
+ height: expanded ? baseHeight + expandableComponentLoader.height : baseHeight;
+ enabled: true;
+
++ KLocale.Locale { id: locale }
++
+ PlasmaCore.Svg {
+ id: svgNetworkIcons;
+
+@@ -46,6 +53,17 @@ ListItem {
+ imagePath: "icons/plasma-networkmanagement2";
+ }
+
++ PlasmaCore.DataSource {
++ id: dataSource;
++
++ property string downloadSource: "network/interfaces/" + DeviceName + "/receiver/data";
++ property string uploadSource: "network/interfaces/" + DeviceName + "/transmitter/data";
++
++ engine: "systemmonitor";
++ connectedSources: showSpeed && mainWindow.isExpanded ? [downloadSource, uploadSource] : [];
++ interval: 2000;
++ }
++
+ Item {
+ id: connectionItemBase;
+
+@@ -399,12 +417,10 @@ ListItem {
+ result += ", " + SecurityTypeString;
+ return result;
+ } else if (ConnectionState == PlasmaNM.Enums.Activated) {
+- if (Type == PlasmaNM.Enums.Wimax ||
+- Type == PlasmaNM.Enums.Wired ||
+- Type == PlasmaNM.Enums.Wireless ||
+- Type == PlasmaNM.Enums.Gsm ||
+- Type == PlasmaNM.Enums.Cdma) {
+- return i18n("Connected, ⬇ %1, ⬆ %2", Download, Upload);
++ if (showSpeed && dataSource.data && dataSource.data[dataSource.downloadSource] && dataSource.data[dataSource.uploadSource]) {
++ return i18n("Connected, ⬇ %1/s, ⬆ %2/s",
++ locale.formatByteSize(dataSource.data[dataSource.downloadSource].value * 1024 || 0),
++ locale.formatByteSize(dataSource.data[dataSource.uploadSource].value * 1024 || 0))
+ } else {
+ return i18n("Connected");
+ }
+diff --git a/applet/declarative/contents/ui/main.qml b/applet/declarative/contents/ui/main.qml
+index 4a7dace..8f8be6e 100644
+--- a/applet/declarative/contents/ui/main.qml
++++ b/applet/declarative/contents/ui/main.qml
+@@ -27,6 +27,7 @@ Item {
+
+ property int minimumWidth: 300;
+ property int minimumHeight: 300;
++ property bool isExpanded: false;
+ property bool showSections: true;
+ property Component compactRepresentation: CompactRepresentation {
+ Component.onCompleted: {
+@@ -121,6 +122,7 @@ Item {
+ Component.onCompleted: {
+ configChanged();
+ plasmoid.addEventListener('configChanged', mainWindow.configChanged)
++ plasmoid.popupEvent.connect(popupEventSlot)
+ }
+
+ function configChanged() {
+@@ -132,4 +134,8 @@ Item {
+ globalConfig.setNetworkSpeedUnit(speedUnit);
+ showSections = plasmoid.readConfig("showSections");
+ }
++
++ function popupEventSlot(popped) {
++ isExpanded = popped;
++ }
+ }
+diff --git a/libs/models/networkmodel.cpp b/libs/models/networkmodel.cpp
+index 7a67f25..23784b1 100644
+--- a/libs/models/networkmodel.cpp
++++ b/libs/models/networkmodel.cpp
+@@ -38,9 +38,9 @@ NetworkModel::NetworkModel(QObject* parent)
+ roles[ConnectionIconRole] = "ConnectionIcon";
+ roles[ConnectionPathRole] = "ConnectionPath";
+ roles[ConnectionStateRole] = "ConnectionState";
++ roles[DeviceNameRole] = "DeviceName";
+ roles[DevicePathRole] = "DevicePath";
+ roles[DeviceStateRole] = "DeviceState";
+- roles[DownloadRole] = "Download";
+ roles[DuplicateRole] = "Duplicate";
+ roles[ItemUniqueNameRole] = "ItemUniqueName";
+ roles[ItemTypeRole] = "ItemType";
+@@ -58,7 +58,6 @@ NetworkModel::NetworkModel(QObject* parent)
+ roles[TimeStampRole] = "TimeStamp";
+ roles[TypeRole] = "Type";
+ roles[UniRole] = "Uni";
+- roles[UploadRole] = "Upload";
+ roles[UuidRole] = "Uuid";
+ roles[VpnState] = "VpnState";
+ setRoleNames(roles);
+@@ -86,12 +85,12 @@ QVariant NetworkModel::data(const QModelIndex& index, int role) const
+ return item->connectionPath();
+ case ConnectionStateRole:
+ return item->connectionState();
++ case DeviceNameRole:
++ return item->deviceName();
+ case DevicePathRole:
+ return item->devicePath();
+ case DeviceStateRole:
+ return item->deviceState();
+- case DownloadRole:
+- return item->download();
+ case DuplicateRole:
+ return item->duplicate();
+ case ItemUniqueNameRole:
+@@ -130,8 +129,6 @@ QVariant NetworkModel::data(const QModelIndex& index, int role) const
+ return item->type();
+ case UniRole:
+ return item->uni();
+- case UploadRole:
+- return item->upload();
+ case UuidRole:
+ return item->uuid();
+ case VpnState:
+@@ -433,8 +430,6 @@ void NetworkModel::addConnection(const NetworkManager::Connection::Ptr& connecti
+
+ item->updateDetails();
+
+- connect(item, SIGNAL(itemUpdated()), SLOT(onItemUpdated()));
+-
+ const int index = m_list.count();
+ beginInsertRows(QModelIndex(), index, index);
+ m_list.insertItem(item);
+@@ -486,8 +481,6 @@ void NetworkModel::addWimaxNsp(const NetworkManager::WimaxNsp::Ptr& nsp, const N
+ item->setType(NetworkManager::ConnectionSettings::Wimax);
+ item->updateDetails();
+
+- connect(item, SIGNAL(itemUpdated()), SLOT(onItemUpdated()));
+-
+ const int index = m_list.count();
+ beginInsertRows(QModelIndex(), index, index);
+ m_list.insertItem(item);
+@@ -529,8 +522,6 @@ void NetworkModel::addWirelessNetwork(const NetworkManager::WirelessNetwork::Ptr
+ item->setSecurityType(securityType);
+ item->updateDetails();
+
+- connect(item, SIGNAL(itemUpdated()), SLOT(onItemUpdated()));
+-
+ const int index = m_list.count();
+ beginInsertRows(QModelIndex(), index, index);
+ m_list.insertItem(item);
+@@ -557,8 +548,6 @@ void NetworkModel::checkAndCreateDuplicate(const QString& connection, const Netw
+ NetworkModelItem * duplicatedItem = new NetworkModelItem(originalItem);
+ duplicatedItem->updateDetails();
+
+- connect(duplicatedItem, SIGNAL(itemUpdated()), SLOT(onItemUpdated()));
+-
+ const int index = m_list.count();
+ beginInsertRows(QModelIndex(), index, index);
+ m_list.insertItem(duplicatedItem);
+diff --git a/libs/models/networkmodel.h b/libs/models/networkmodel.h
+index 82080e5..c718d74 100644
+--- a/libs/models/networkmodel.h
++++ b/libs/models/networkmodel.h
+@@ -49,9 +49,9 @@ public:
+ ConnectionIconRole,
+ ConnectionPathRole,
+ ConnectionStateRole,
++ DeviceNameRole,
+ DevicePathRole,
+ DeviceStateRole,
+- DownloadRole,
+ DuplicateRole,
+ ItemUniqueNameRole,
+ ItemTypeRole,
+@@ -70,7 +70,6 @@ public:
+ TypeRole,
+ UniRole,
+ UuidRole,
+- UploadRole,
+ VpnState,
+ };
+
+diff --git a/libs/models/networkmodelitem.cpp b/libs/models/networkmodelitem.cpp
+index 7e28c0d..3d0bfc4 100644
+--- a/libs/models/networkmodelitem.cpp
++++ b/libs/models/networkmodelitem.cpp
+@@ -50,13 +50,11 @@ NetworkModelItem::NetworkModelItem(QObject* parent)
+ , m_connectionState(NetworkManager::ActiveConnection::Deactivated)
+ , m_deviceState(NetworkManager::Device::UnknownState)
+ , m_duplicate(false)
+- , m_engine(0)
+ , m_mode(NetworkManager::WirelessSetting::Infrastructure)
+ , m_securityType(NetworkManager::Utils::None)
+ , m_signal(0)
+ , m_slave(false)
+ , m_type(NetworkManager::ConnectionSettings::Unknown)
+- , m_updateEnabled(false)
+ , m_vpnState(NetworkManager::VpnConnection::Unknown)
+ {
+ }
+@@ -66,7 +64,6 @@ NetworkModelItem::NetworkModelItem(const NetworkModelItem* item, QObject* parent
+ , m_connectionPath(item->connectionPath())
+ , m_connectionState(NetworkManager::ActiveConnection::Deactivated)
+ , m_duplicate(true)
+- , m_engine(0)
+ , m_mode(item->mode())
+ , m_name(item->name())
+ , m_securityType(item->securityType())
+@@ -111,12 +108,6 @@ NetworkManager::ActiveConnection::State NetworkModelItem::connectionState() cons
+ void NetworkModelItem::setConnectionState(NetworkManager::ActiveConnection::State state)
+ {
+ m_connectionState = state;
+-
+- if (m_connectionState == NetworkManager::ActiveConnection::Activated && !m_devicePath.isEmpty()) {
+- initializeDataEngine();
+- } else {
+- removeDataEngine();
+- }
+ }
+
+ QString NetworkModelItem::details() const
+@@ -129,6 +120,11 @@ QString NetworkModelItem::devicePath() const
+ return m_devicePath;
+ }
+
++QString NetworkModelItem::deviceName() const
++{
++ return m_deviceName;
++}
++
+ void NetworkModelItem::setDeviceName(const QString& name)
+ {
+ m_deviceName = name;
+@@ -149,12 +145,6 @@ void NetworkModelItem::setDeviceState(const NetworkManager::Device::State state)
+ m_deviceState = state;
+ }
+
+-QString NetworkModelItem::download() const
+-{
+- double download = m_download.toDouble();
+- return KGlobal::locale()->formatByteSize(download*1024) + "/s";
+-}
+-
+ bool NetworkModelItem::duplicate() const
+ {
+ return m_duplicate;
+@@ -404,12 +394,6 @@ QString NetworkModelItem::uni() const
+ }
+ }
+
+-QString NetworkModelItem::upload() const
+-{
+- double upload = m_upload.toDouble();
+- return KGlobal::locale()->formatByteSize(upload*1024) + "/s";
+-}
+-
+ QString NetworkModelItem::uuid() const
+ {
+ return m_uuid;
+@@ -515,64 +499,3 @@ void NetworkModelItem::updateDetails()
+
+ m_details += "</table></qt>";
+ }
+-
+-void NetworkModelItem::dataUpdated(const QString& sourceName, const Plasma::DataEngine::Data& data)
+-{
+- if (sourceName == m_uploadSource) {
+- m_upload = data["value"].toString();
+- } else if (sourceName == m_downloadSource) {
+- m_download = data["value"].toString();
+- }
+- Q_EMIT itemUpdated();
+-}
+-
+-void NetworkModelItem::initializeDataEngine()
+-{
+- Plasma::DataEngineManager::self()->loadEngine("systemmonitor");
+-
+- NetworkManager::Device::Ptr device = NetworkManager::findNetworkInterface(m_devicePath);
+- if (!device) {
+- removeDataEngine();
+- return;
+- }
+-
+- QString interfaceName = device->ipInterfaceName();
+- if (interfaceName.isEmpty()) {
+- interfaceName = device->interfaceName();
+- }
+-
+- m_downloadSource = QString("network/interfaces/%1/receiver/data").arg(interfaceName);
+- m_uploadSource = QString("network/interfaces/%1/transmitter/data").arg(interfaceName);
+-
+- Plasma::DataEngine * engine = Plasma::DataEngineManager::self()->engine("systemmonitor");
+- if (engine->isValid() && engine->query(m_downloadSource).empty()) {
+- Plasma::DataEngineManager::self()->unloadEngine("systemmonitor");
+- Plasma::DataEngineManager::self()->loadEngine("systemmonitor");
+- }
+-
+- setUpdateEnabled(true);
+-}
+-
+-void NetworkModelItem::removeDataEngine()
+-{
+- setUpdateEnabled(false);
+-}
+-
+-void NetworkModelItem::setUpdateEnabled(bool enabled)
+-{
+- Plasma::DataEngine * engine = Plasma::DataEngineManager::self()->engine("systemmonitor");
+- NetworkManager::Device::Ptr device = NetworkManager::findNetworkInterface(m_devicePath);
+- if (engine->isValid()) {
+- int interval = 2000;
+- if (enabled) {
+- if (device) {
+- engine->connectSource(m_downloadSource, this, interval);
+- engine->connectSource(m_uploadSource, this, interval);
+- }
+- } else {
+- engine->disconnectSource(m_downloadSource, this);
+- engine->disconnectSource(m_uploadSource, this);
+- }
+- }
+- m_updateEnabled = enabled;
+-}
+diff --git a/libs/models/networkmodelitem.h b/libs/models/networkmodelitem.h
+index 14b4f05..36b6cf1 100644
+--- a/libs/models/networkmodelitem.h
++++ b/libs/models/networkmodelitem.h
+@@ -27,8 +27,6 @@
+ #include <NetworkManagerQt/Device>
+ #include <NetworkManagerQt/Utils>
+
+-#include <Plasma/DataEngine>
+-
+ #include "networkmodel.h"
+ #include "plasmanm_export.h"
+
+@@ -54,15 +52,15 @@ public:
+
+ QString details() const;
+
+- QString devicePath() const;
++ QString deviceName() const;
+ void setDeviceName(const QString& name);
++
++ QString devicePath() const;
+ void setDevicePath(const QString& path);
+
+ QString deviceState() const;
+ void setDeviceState(const NetworkManager::Device::State state);
+
+- QString download() const;
+-
+ bool duplicate() const;
+
+ QString icon() const;
+@@ -105,8 +103,6 @@ public:
+
+ QString uni() const;
+
+- QString upload() const;
+-
+ QString uuid() const;
+ void setUuid(const QString& uuid);
+
+@@ -116,17 +112,9 @@ public:
+ bool operator==(const NetworkModelItem * item) const;
+
+ public Q_SLOTS:
+- void dataUpdated(const QString & sourceName, const Plasma::DataEngine::Data & data);
+ void updateDetails();
+
+-Q_SIGNALS:
+- void itemUpdated();
+-
+ private:
+- void initializeDataEngine();
+- void removeDataEngine();
+- void setUpdateEnabled(bool enabled);
+-
+ QString m_activeConnectionPath;
+ QString m_connectionPath;
+ NetworkManager::ActiveConnection::State m_connectionState;
+@@ -134,10 +122,7 @@ private:
+ QString m_deviceName;
+ NetworkManager::Device::State m_deviceState;
+ QString m_details;
+- QString m_download;
+- QString m_downloadSource;
+ bool m_duplicate;
+- Plasma::DataEngine * m_engine;
+ NetworkManager::WirelessSetting::NetworkMode m_mode;
+ QString m_name;
+ QString m_nsp;
+@@ -148,9 +133,6 @@ private:
+ QString m_ssid;
+ QDateTime m_timestamp;
+ NetworkManager::ConnectionSettings::ConnectionType m_type;
+- QString m_upload;
+- QString m_uploadSource;
+- bool m_updateEnabled;
+ QString m_uuid;
+ NetworkManager::VpnConnection::State m_vpnState;
+ };
diff --git a/plasma-nm-connect-to-the-correct-signal.patch b/plasma-nm-connect-to-the-correct-signal.patch
new file mode 100644
index 0000000..5ffff12
--- /dev/null
+++ b/plasma-nm-connect-to-the-correct-signal.patch
@@ -0,0 +1,13 @@
+diff --git a/kded/service.cpp b/kded/service.cpp
+index 0e724ad..2c90d2b 100644
+--- a/kded/service.cpp
++++ b/kded/service.cpp
+@@ -65,7 +65,7 @@ NetworkManagementService::NetworkManagementService(QObject * parent, const QVari
+ #endif
+ d->bluetoothMonitor = 0;
+
+- connect(this, SIGNAL(slotRegistered(QDBusObjectPath)), this, SLOT(slotRegistered(QDBusObjectPath)));
++ connect(this, SIGNAL(moduleRegistered(QDBusObjectPath)), this, SLOT(slotRegistered(QDBusObjectPath)));
+ }
+
+ NetworkManagementService::~NetworkManagementService()
diff --git a/plasma-nm-delay-notifications-and-secret-agent-initializations.patch b/plasma-nm-delay-notifications-and-secret-agent-initializations.patch
new file mode 100644
index 0000000..b6bc1cc
--- /dev/null
+++ b/plasma-nm-delay-notifications-and-secret-agent-initializations.patch
@@ -0,0 +1,125 @@
+diff --git a/kded/service.cpp b/kded/service.cpp
+index ec21b45..a27c148 100644
+--- a/kded/service.cpp
++++ b/kded/service.cpp
+@@ -57,19 +57,13 @@ NetworkManagementService::NetworkManagementService(QObject * parent, const QVari
+ {
+ Q_D(NetworkManagementService);
+
+- QDBusReply<bool> notificationsReply = QDBusConnection::sessionBus().interface()->isServiceRegistered("org.freedesktop.Notifications");
+- if (notificationsReply.value()) {
+- initializeNotifications();
+- } else {
+- QDBusServiceWatcher * watcher = new QDBusServiceWatcher("org.freedesktop.Notifications", QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this);
+- connect(watcher, SIGNAL(serviceRegistered()), this, SLOT(doInitializeNotifications()));
+- }
++ d->agent = Q_NULLPTR;
++ d->notification = Q_NULLPTR;
+
+ #if WITH_MODEMMANAGER_SUPPORT
+- d->modemMonitor = new ModemMonitor(this);
++ d->modemMonitor = Q_NULLPTR;
+ #endif
+- d->bluetoothMonitor = new BluetoothMonitor(this);
+- d->agent = new SecretAgent(this);
++ d->bluetoothMonitor = Q_NULLPTR;
+ }
+
+ NetworkManagementService::~NetworkManagementService()
+@@ -77,17 +71,25 @@ NetworkManagementService::~NetworkManagementService()
+ delete d_ptr;
+ }
+
+-void NetworkManagementService::doInitializeNotifications()
++void NetworkManagementService::init()
+ {
+- QDBusServiceWatcher * watcher = static_cast<QDBusServiceWatcher*>(sender());
+- watcher->deleteLater();
++ Q_D(NetworkManagementService);
+
+- initializeNotifications();
+-}
++ if (!d->agent) {
++ d->agent = new SecretAgent(this);
++ }
+
+-void NetworkManagementService::initializeNotifications()
+-{
+- Q_D(NetworkManagementService);
++ if (!d->notification) {
++ d->notification = new Notification(this);
++ }
++
++#if WITH_MODEMMANAGER_SUPPORT
++ if (!d->modemMonitor) {
++ d->modemMonitor = new ModemMonitor(this);
++ }
++#endif
+
+- d->notification = new Notification(this);
++ if (!d->bluetoothMonitor) {
++ d->bluetoothMonitor = new BluetoothMonitor(this);
++ }
+ }
+diff --git a/kded/service.h b/kded/service.h
+index ef626eb..08d90fd 100644
+--- a/kded/service.h
++++ b/kded/service.h
+@@ -35,18 +35,18 @@ class NetworkManagementServicePrivate;
+
+ class PLASMA_NM_EXPORT NetworkManagementService : public KDEDModule
+ {
++ Q_CLASSINFO("D-Bus Interface", "org.kde.plasmanetworkmanagement")
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(NetworkManagementService)
+ public:
+ NetworkManagementService(QObject * parent, const QVariantList&);
+ virtual ~NetworkManagementService();
++
+ public Q_SLOTS:
+- void doInitializeNotifications();
++ Q_SCRIPTABLE void init();
+
+ private:
+ NetworkManagementServicePrivate * d_ptr;
+-
+- void initializeNotifications();
+ };
+
+ #endif // PLASMANM_KDED_SERVICE_H
+diff --git a/libs/handler.cpp b/libs/handler.cpp
+index 875ef03..cb8e71f 100644
+--- a/libs/handler.cpp
++++ b/libs/handler.cpp
+@@ -53,7 +53,10 @@ Handler::Handler(QObject* parent)
+ , m_tmpWimaxEnabled(NetworkManager::isWimaxEnabled())
+ , m_tmpWirelessEnabled(NetworkManager::isWirelessEnabled())
+ , m_tmpWwanEnabled(NetworkManager::isWwanEnabled())
++ , m_agentIface(QStringLiteral("org.kde.kded5"), QStringLiteral("/modules/networkmanagement"),
++ QStringLiteral("org.kde.plasmanetworkmanagement"))
+ {
++ m_agentIface.call(QStringLiteral("init"));
+ }
+
+ Handler::~Handler()
+diff --git a/libs/handler.h b/libs/handler.h
+index 23a4628..d614e82 100644
+--- a/libs/handler.h
++++ b/libs/handler.h
+@@ -21,6 +21,8 @@
+ #ifndef PLASMA_NM_HANDLER_H
+ #define PLASMA_NM_HANDLER_H
+
++#include <QDBusInterface>
++
+ #include <NetworkManagerQt/Connection>
+
+ #include "plasmanm_export.h"
+@@ -109,6 +111,7 @@ private:
+ QString m_tmpSpecificPath;
+
+ bool isBtEnabled();
++ QDBusInterface m_agentIface;
+ };
+
+ #endif // PLASMA_NM_HANDLER_H
diff --git a/plasma-nm-display-wifi-available-icon-when-there-is-available-ap.patch b/plasma-nm-display-wifi-available-icon-when-there-is-available-ap.patch
new file mode 100644
index 0000000..c035066
--- /dev/null
+++ b/plasma-nm-display-wifi-available-icon-when-there-is-available-ap.patch
@@ -0,0 +1,15 @@
+--- a/libs/declarative/connectionicon.cpp
++++ b/libs/declarative/connectionicon.cpp
+@@ -414,7 +414,10 @@
+ } else if (device->type() == NetworkManager::Device::Wifi &&
+ NetworkManager::isWirelessEnabled() &&
+ NetworkManager::isWirelessHardwareEnabled()) {
+- wireless = true;
++ NetworkManager::WirelessDevice::Ptr wifiDevice = device.objectCast<NetworkManager::WirelessDevice>();
++ if (!wifiDevice->accessPoints().isEmpty()) {
++ wireless = true;
++ }
+ } else if (device->type() == NetworkManager::Device::Modem &&
+ NetworkManager::isWwanEnabled() &&
+ NetworkManager::isWwanHardwareEnabled()) {
+
diff --git a/plasma-nm-do-not-ask-for-8021x-secrets-when-using-LEAP.patch b/plasma-nm-do-not-ask-for-8021x-secrets-when-using-LEAP.patch
new file mode 100644
index 0000000..056f4e0
--- /dev/null
+++ b/plasma-nm-do-not-ask-for-8021x-secrets-when-using-LEAP.patch
@@ -0,0 +1,14 @@
+diff --git a/libs/editor/connectiondetaileditor.cpp b/libs/editor/connectiondetaileditor.cpp
+index 9954599..d853bf0 100644
+--- a/libs/editor/connectiondetaileditor.cpp
++++ b/libs/editor/connectiondetaileditor.cpp
+@@ -234,7 +234,8 @@ void ConnectionDetailEditor::initEditor()
+ NetworkManager::WirelessSecuritySetting::Ptr wifiSecuritySetting = connection->settings()->setting(NetworkManager::Setting::WirelessSecurity).staticCast<NetworkManager::WirelessSecuritySetting>();
+ if (wifiSecuritySetting &&
+ (wifiSecuritySetting->keyMgmt() == NetworkManager::WirelessSecuritySetting::WpaEap ||
+- wifiSecuritySetting->keyMgmt() == NetworkManager::WirelessSecuritySetting::WirelessSecuritySetting::Ieee8021x)) {
++ (wifiSecuritySetting->keyMgmt() == NetworkManager::WirelessSecuritySetting::WirelessSecuritySetting::Ieee8021x &&
++ wifiSecuritySetting->authAlg() != WirelessSecuritySetting::Leap))) {
+ NetworkManager::Security8021xSetting::Ptr securitySetting = connection->settings()->setting(NetworkManager::Setting::Security8021x).staticCast<NetworkManager::Security8021xSetting>();
+ if (securitySetting && !securitySetting->needSecrets().isEmpty()) {
+ hasSecrets = true;
diff --git a/plasma-nm-do-not-insert-empty-vpn-banner.patch b/plasma-nm-do-not-insert-empty-vpn-banner.patch
new file mode 100644
index 0000000..67b0e6d
--- /dev/null
+++ b/plasma-nm-do-not-insert-empty-vpn-banner.patch
@@ -0,0 +1,13 @@
+diff --git a/libs/uiutils.cpp b/libs/uiutils.cpp
+index 1f61c13..8f666d5 100644
+--- a/libs/uiutils.cpp
++++ b/libs/uiutils.cpp
+@@ -736,7 +736,7 @@ QString UiUtils::vpnDetails(const VpnConnection::Ptr& vpnConnection, const VpnSe
+ details += QString(format).arg(i18n("VPN plugin:"), vpnSetting->serviceType().section('.', -1));
+ }
+ } else if (key == "vpn:banner") {
+- if (vpnConnection) {
++ if (vpnConnection && !vpnConnection->banner().isEmpty()) {
+ details += QString(format).arg(i18n("Banner:"), vpnConnection->banner().simplified());
+ }
+ }
diff --git a/plasma-nm-do-not-keep-trying-to-open-kwallet-if-we-failed-before.patch b/plasma-nm-do-not-keep-trying-to-open-kwallet-if-we-failed-before.patch
new file mode 100644
index 0000000..50057d1
--- /dev/null
+++ b/plasma-nm-do-not-keep-trying-to-open-kwallet-if-we-failed-before.patch
@@ -0,0 +1,60 @@
+diff --git a/kded/secretagent.cpp b/kded/secretagent.cpp
+index 2729512..07711a5 100644
+--- a/kded/secretagent.cpp
++++ b/kded/secretagent.cpp
+@@ -43,10 +43,11 @@
+ #include <KWallet/Wallet>
+ #include <QDebug>
+
+-SecretAgent::SecretAgent(QObject* parent):
+- NetworkManager::SecretAgent("org.kde.networkmanagement", parent),
+- m_wallet(0),
+- m_dialog(0)
++SecretAgent::SecretAgent(QObject* parent)
++ : NetworkManager::SecretAgent("org.kde.networkmanagement", parent)
++ , m_openWalletFailed(false)
++ , m_wallet(0)
++ , m_dialog(0)
+ {
+ connect(NetworkManager::notifier(), SIGNAL(serviceDisappeared()),
+ this, SLOT(killDialogs()));
+@@ -253,9 +254,13 @@ void SecretAgent::killDialogs()
+ void SecretAgent::walletOpened(bool success)
+ {
+ if (!success) {
++ m_openWalletFailed = true;
+ m_wallet->deleteLater();
+ m_wallet = 0;
++ } else {
++ m_openWalletFailed = false;
+ }
++
+ processNext();
+ }
+
+@@ -455,6 +460,13 @@ bool SecretAgent::useWallet() const
+ return true;
+ }
+
++ /* If opening of KWallet failed before, we should not try to open it again and
++ * we should return false instead */
++ if (m_openWalletFailed) {
++ m_openWalletFailed = false;
++ return false;
++ }
++
+ if (KWallet::Wallet::isEnabled()) {
+ m_wallet = KWallet::Wallet::openWallet(KWallet::Wallet::LocalWallet(), 0, KWallet::Wallet::Asynchronous);
+ if (m_wallet) {
+diff --git a/kded/secretagent.h b/kded/secretagent.h
+index 00d13ef..9de7daf 100644
+--- a/kded/secretagent.h
++++ b/kded/secretagent.h
+@@ -114,6 +114,7 @@ private:
+ bool hasSecrets(const NMVariantMapMap &connection) const;
+ void sendSecrets(const NMVariantMapMap &secrets, const QDBusMessage &message) const;
+
++ mutable bool m_openWalletFailed;
+ mutable KWallet::Wallet *m_wallet;
+ mutable PasswordDialog *m_dialog;
+ QList<SecretsRequest> m_calls;
diff --git a/plasma-nm-do-not-mark-secrets-as-agent-owned-when-not-running-kwallet.patch b/plasma-nm-do-not-mark-secrets-as-agent-owned-when-not-running-kwallet.patch
new file mode 100644
index 0000000..ce06654
--- /dev/null
+++ b/plasma-nm-do-not-mark-secrets-as-agent-owned-when-not-running-kwallet.patch
@@ -0,0 +1,33 @@
+--- a/libs/handler.cpp
++++ b/libs/handler.cpp
+@@ -45,6 +45,7 @@
+ #include <KService>
+ #include <KServiceTypeTrader>
+ #include <KWindowSystem>
++#include <KWallet/Wallet>
+
+ Handler::Handler(QObject* parent)
+ : QObject(parent)
+@@ -160,7 +161,9 @@
+ if (securityType == NetworkManager::Utils::StaticWep) {
+ wifiSecurity->setKeyMgmt(NetworkManager::WirelessSecuritySetting::Wep);
+ wifiSecurity->setWepKey0(password);
+- wifiSecurity->setWepKeyFlags(NetworkManager::Setting::AgentOwned);
++ if (KWallet::Wallet::isEnabled()) {
++ wifiSecurity->setWepKeyFlags(NetworkManager::Setting::AgentOwned);
++ }
+ } else {
+ if (ap->mode() == NetworkManager::AccessPoint::Adhoc) {
+ wifiSecurity->setKeyMgmt(NetworkManager::WirelessSecuritySetting::WpaNone);
+@@ -168,7 +171,9 @@
+ wifiSecurity->setKeyMgmt(NetworkManager::WirelessSecuritySetting::WpaPsk);
+ }
+ wifiSecurity->setPsk(password);
+- wifiSecurity->setPskFlags(NetworkManager::Setting::AgentOwned);
++ if (KWallet::Wallet::isEnabled()) {
++ wifiSecurity->setPskFlags(NetworkManager::Setting::AgentOwned);
++ }
+ }
+ QDBusPendingReply<QDBusObjectPath> reply = NetworkManager::addAndActivateConnection(settings->toMap(), device, specificObject);
+ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this);
+
diff --git a/plasma-nm-do-not-use-protected-icon-when-security-is-unknown.patch b/plasma-nm-do-not-use-protected-icon-when-security-is-unknown.patch
new file mode 100644
index 0000000..ac18003
--- /dev/null
+++ b/plasma-nm-do-not-use-protected-icon-when-security-is-unknown.patch
@@ -0,0 +1,30 @@
+--- a/libs/models/networkmodelitem.cpp
++++ b/libs/models/networkmodelitem.cpp
+@@ -230,19 +230,19 @@
+ case NetworkManager::ConnectionSettings::Wireless:
+ if (m_signal == 0 ) {
+ if (m_mode == NetworkManager::WirelessSetting::Adhoc || m_mode == NetworkManager::WirelessSetting::Ap) {
+- return (m_securityType == NetworkManager::Utils::None) ? "network-wireless-100" : "network-wireless-100-locked";
++ return (m_securityType <= NetworkManager::Utils::None) ? "network-wireless-100" : "network-wireless-100-locked";
+ }
+- return (m_securityType == NetworkManager::Utils::None) ? "network-wireless-0" : "network-wireless-0-locked";
++ return (m_securityType <= NetworkManager::Utils::None) ? "network-wireless-0" : "network-wireless-0-locked";
+ } else if (m_signal < 20) {
+- return (m_securityType == NetworkManager::Utils::None) ? "network-wireless-20" : "network-wireless-20-locked";
++ return (m_securityType <= NetworkManager::Utils::None) ? "network-wireless-20" : "network-wireless-20-locked";
+ } else if (m_signal < 40) {
+- return (m_securityType == NetworkManager::Utils::None) ? "network-wireless-40" : "network-wireless-40-locked";
++ return (m_securityType <= NetworkManager::Utils::None) ? "network-wireless-40" : "network-wireless-40-locked";
+ } else if (m_signal < 60) {
+- return (m_securityType == NetworkManager::Utils::None) ? "network-wireless-60" : "network-wireless-60-locked";
++ return (m_securityType <= NetworkManager::Utils::None) ? "network-wireless-60" : "network-wireless-60-locked";
+ } else if (m_signal < 80) {
+- return (m_securityType == NetworkManager::Utils::None) ? "network-wireless-80" : "network-wireless-80-locked";
++ return (m_securityType <= NetworkManager::Utils::None) ? "network-wireless-80" : "network-wireless-80-locked";
+ } else {
+- return (m_securityType == NetworkManager::Utils::None) ? "network-wireless-100" : "network-wireless-100-locked";
++ return (m_securityType <= NetworkManager::Utils::None) ? "network-wireless-100" : "network-wireless-100-locked";
+ }
+ break;
+ default:
+
diff --git a/plasma-nm-fix-request-scan-reply-handling.patch b/plasma-nm-fix-request-scan-reply-handling.patch
new file mode 100644
index 0000000..632b1a5
--- /dev/null
+++ b/plasma-nm-fix-request-scan-reply-handling.patch
@@ -0,0 +1,12 @@
+--- a/libs/handler.cpp
++++ b/libs/handler.cpp
+@@ -364,7 +364,7 @@
+
+ void Handler::replyFinished(QDBusPendingCallWatcher * watcher)
+ {
+- QDBusPendingReply<QDBusObjectPath> reply = *watcher;
++ QDBusPendingReply<> reply = *watcher;
+ if (reply.isError() || !reply.isValid()) {
+ KNotification *notification = 0;
+ QString error = reply.error().message();
+
diff --git a/plasma-nm-prevent-error.patch b/plasma-nm-prevent-error.patch
new file mode 100644
index 0000000..38e1ffc
--- /dev/null
+++ b/plasma-nm-prevent-error.patch
@@ -0,0 +1,15 @@
+diff --git a/kded/secretagent.cpp b/kded/secretagent.cpp
+index 0572c74..2729512 100644
+--- a/kded/secretagent.cpp
++++ b/kded/secretagent.cpp
+@@ -540,8 +540,8 @@ void SecretAgent::importSecretsFromPlainTextFiles()
+ }
+
+ // Add loaded secrets from the config file
+- QMap<QString, QString>::const_iterator it = secrets.begin();
+- QMap<QString, QString>::const_iterator end = secrets.end();
++ QMap<QString, QString>::const_iterator it = secrets.constBegin();
++ QMap<QString, QString>::const_iterator end = secrets.constEnd();
+ for (; it != end; ++it) {
+ tmpSetting.insert(it.key(), it.value());
+ }
diff --git a/plasma-nm-prevent-from-crash-when-requesting-secrets-supposed-to-be-merged-with-secrets.patch b/plasma-nm-prevent-from-crash-when-requesting-secrets-supposed-to-be-merged-with-secrets.patch
new file mode 100644
index 0000000..5742cf3
--- /dev/null
+++ b/plasma-nm-prevent-from-crash-when-requesting-secrets-supposed-to-be-merged-with-secrets.patch
@@ -0,0 +1,24 @@
+diff --git a/libs/editor/connectiondetaileditor.cpp b/libs/editor/connectiondetaileditor.cpp
+index d853bf0..f6b6335 100644
+--- a/libs/editor/connectiondetaileditor.cpp
++++ b/libs/editor/connectiondetaileditor.cpp
+@@ -194,7 +194,7 @@ void ConnectionDetailEditor::initEditor()
+ connect(connection.data(), SIGNAL(gotSecrets(QString,bool,NMVariantMapMap,QString)),
+ SLOT(gotSecrets(QString,bool,NMVariantMapMap,QString)), Qt::UniqueConnection);
+
+- if (m_connection->connectionType() == NetworkManager::ConnectionSettings::Adsl) {
++ if (m_connection->connectionType() == NetworkManager::ConnectionSettings::Adsl) {
+ NetworkManager::AdslSetting::Ptr adslSetting = connection->settings()->setting(NetworkManager::Setting::Adsl).staticCast<NetworkManager::AdslSetting>();
+ if (adslSetting && !adslSetting->needSecrets().isEmpty()) {
+ hasSecrets = true;
+@@ -502,7 +502,9 @@ void ConnectionDetailEditor::gotSecrets(const QString& id, bool success, const N
+ if (id == m_connection->uuid() && success) {
+ foreach (const QString & key, secrets.keys()) {
+ NetworkManager::Setting::Ptr setting = m_connection->setting(NetworkManager::Setting::typeFromString(key));
+- setting->secretsFromMap(secrets.value(key));
++ if (setting) {
++ setting->secretsFromMap(secrets.value(key));
++ }
+ }
+ }
+
diff --git a/plasma-nm-re-save-migrate-secrets-stored-in-files.patch b/plasma-nm-re-save-migrate-secrets-stored-in-files.patch
new file mode 100644
index 0000000..098da4a
--- /dev/null
+++ b/plasma-nm-re-save-migrate-secrets-stored-in-files.patch
@@ -0,0 +1,115 @@
+diff --git a/kded/secretagent.cpp b/kded/secretagent.cpp
+index dbbd1dc..0572c74 100644
+--- a/kded/secretagent.cpp
++++ b/kded/secretagent.cpp
+@@ -37,9 +37,11 @@
+ #include <KPluginFactory>
+ #include <KWindowSystem>
+ #include <KDialog>
+-#include <KWallet/Wallet>
+-
+ #include <KDebug>
++#include <KConfig>
++#include <KConfigGroup>
++#include <KWallet/Wallet>
++#include <QDebug>
+
+ SecretAgent::SecretAgent(QObject* parent):
+ NetworkManager::SecretAgent("org.kde.networkmanagement", parent),
+@@ -48,6 +50,9 @@ SecretAgent::SecretAgent(QObject* parent):
+ {
+ connect(NetworkManager::notifier(), SIGNAL(serviceDisappeared()),
+ this, SLOT(killDialogs()));
++
++ // We have to import secrets previously stored in plaintext files
++ importSecretsFromPlainTextFiles();
+ }
+
+ SecretAgent::~SecretAgent()
+@@ -487,3 +492,72 @@ void SecretAgent::sendSecrets(const NMVariantMapMap &secrets, const QDBusMessage
+ kWarning() << "Failed put the secret into the queue";
+ }
+ }
++
++void SecretAgent::importSecretsFromPlainTextFiles()
++{
++ KConfig config(QLatin1String("plasma-networkmanagement"), KConfig::SimpleConfig);
++
++ // No action is required when the list of secrets is empty
++ if (!config.groupList().isEmpty()) {
++ foreach (const QString &groupName, config.groupList()) {
++ QString loadedUuid = groupName.split(';').first().remove('{').remove('}');
++ QString loadedSettingType = groupName.split(';').last();
++ NetworkManager::Connection::Ptr connection = NetworkManager::findConnectionByUuid(loadedUuid);
++ if (connection) {
++ NetworkManager::Setting::SecretFlags secretFlags = KWallet::Wallet::isEnabled() ? NetworkManager::Setting::AgentOwned : NetworkManager::Setting::None;
++ QMap<QString, QString> secrets = config.entryMap(groupName);
++ NMVariantMapMap settings = connection->settings()->toMap();
++
++ foreach (const QString &setting, settings.keys()) {
++ if (setting == QLatin1String("vpn")) {
++ NetworkManager::VpnSetting::Ptr vpnSetting = connection->settings()->setting(NetworkManager::Setting::Vpn).staticCast<NetworkManager::VpnSetting>();
++ if (vpnSetting) {
++ // Add loaded secrets from the config file
++ vpnSetting->secretsFromStringMap(secrets);
++
++ NMStringMap vpnData = vpnSetting->data();
++ // Reset flags, we can't save secrets to our secret agent when KWallet is not enabled, because
++ // we dropped support for plaintext files, therefore they need to be stored to NetworkManager
++ foreach (const QString &key, vpnData.keys()) {
++ if (key.endsWith(QLatin1String("-flags"))) {
++ vpnData.insert(key, QString::number((int)secretFlags));
++ }
++ }
++
++ vpnSetting->setData(vpnData);
++ settings.insert(setting, vpnSetting->toMap());
++ connection->update(settings);
++ }
++ } else {
++ if (setting == loadedSettingType) {
++ QVariantMap tmpSetting = settings.value(setting);
++ // Reset flags, we can't save secrets to our secret agent when KWallet is not enabled, because
++ // we dropped support for plaintext files, therefore they need to be stored to NetworkManager
++ foreach (const QString &key, tmpSetting.keys()) {
++ if (key.endsWith(QLatin1String("-flags"))) {
++ tmpSetting.insert(key, (int)secretFlags);
++ }
++ }
++
++ // Add loaded secrets from the config file
++ QMap<QString, QString>::const_iterator it = secrets.begin();
++ QMap<QString, QString>::const_iterator end = secrets.end();
++ for (; it != end; ++it) {
++ tmpSetting.insert(it.key(), it.value());
++ }
++
++ // Replace the old setting with the new one
++ settings.insert(setting, tmpSetting);
++ // Update the connection which re-saves secrets
++ connection->update(settings);
++ }
++ }
++ }
++ }
++
++ // Remove the group
++ KConfigGroup group(&config, groupName);
++ group.deleteGroup();
++ }
++ }
++}
+diff --git a/kded/secretagent.h b/kded/secretagent.h
+index 0b7a0c8..00d13ef 100644
+--- a/kded/secretagent.h
++++ b/kded/secretagent.h
+@@ -117,6 +117,9 @@ private:
+ mutable KWallet::Wallet *m_wallet;
+ mutable PasswordDialog *m_dialog;
+ QList<SecretsRequest> m_calls;
++
++ void importSecretsFromPlainTextFiles();
++
+ };
+
+ #endif // PLASMA_NM_SECRET_AGENT_H
diff --git a/plasma-nm-remove-shebang-from-desktop-file.patch b/plasma-nm-remove-shebang-from-desktop-file.patch
new file mode 100644
index 0000000..ad06bc0
--- /dev/null
+++ b/plasma-nm-remove-shebang-from-desktop-file.patch
@@ -0,0 +1,9 @@
+diff --git a/editor/kde-nm-connection-editor.desktop b/editor/kde-nm-connection-editor.desktop
+index 3bfc271..5882393 100755
+--- a/editor/kde-nm-connection-editor.desktop
++++ b/editor/kde-nm-connection-editor.desktop
+@@ -1,4 +1,3 @@
+-#!/usr/bin/env xdg-open
+ [Desktop Entry]
+ Name=kde-nm-connection-editor
+ Name[bg]=kde-nm-connection-editor
diff --git a/plasma-nm-replace-qt5-stuff.patch b/plasma-nm-replace-qt5-stuff.patch
new file mode 100644
index 0000000..c79818c
--- /dev/null
+++ b/plasma-nm-replace-qt5-stuff.patch
@@ -0,0 +1,40 @@
+diff --git a/kded/service.cpp b/kded/service.cpp
+index a27c148..3d30e1f 100644
+--- a/kded/service.cpp
++++ b/kded/service.cpp
+@@ -57,13 +57,13 @@ NetworkManagementService::NetworkManagementService(QObject * parent, const QVari
+ {
+ Q_D(NetworkManagementService);
+
+- d->agent = Q_NULLPTR;
+- d->notification = Q_NULLPTR;
++ d->agent = 0;
++ d->notification = 0;
+
+ #if WITH_MODEMMANAGER_SUPPORT
+- d->modemMonitor = Q_NULLPTR;
++ d->modemMonitor = 0;
+ #endif
+- d->bluetoothMonitor = Q_NULLPTR;
++ d->bluetoothMonitor = 0;
+ }
+
+ NetworkManagementService::~NetworkManagementService()
+diff --git a/libs/handler.cpp b/libs/handler.cpp
+index d3c1454..7a31787 100644
+--- a/libs/handler.cpp
++++ b/libs/handler.cpp
+@@ -53,10 +53,10 @@ Handler::Handler(QObject* parent)
+ , m_tmpWimaxEnabled(NetworkManager::isWimaxEnabled())
+ , m_tmpWirelessEnabled(NetworkManager::isWirelessEnabled())
+ , m_tmpWwanEnabled(NetworkManager::isWwanEnabled())
+- , m_agentIface(QStringLiteral("org.kde.kded"), QStringLiteral("/modules/networkmanagement"),
+- QStringLiteral("org.kde.plasmanetworkmanagement"))
++ , m_agentIface(QLatin1String("org.kde.kded"), QLatin1String("/modules/networkmanagement"),
++ QLatin1String("org.kde.plasmanetworkmanagement"))
+ {
+- m_agentIface.call(QStringLiteral("init"));
++ m_agentIface.call(QLatin1String("init"));
+ }
+
+ Handler::~Handler()
diff --git a/plasma-nm-request-secrets-only-when-needed.patch b/plasma-nm-request-secrets-only-when-needed.patch
new file mode 100644
index 0000000..b491941
--- /dev/null
+++ b/plasma-nm-request-secrets-only-when-needed.patch
@@ -0,0 +1,234 @@
+diff --git a/libs/editor/connectiondetaileditor.cpp b/libs/editor/connectiondetaileditor.cpp
+index f626ec3..9954599 100644
+--- a/libs/editor/connectiondetaileditor.cpp
++++ b/libs/editor/connectiondetaileditor.cpp
+@@ -22,36 +22,40 @@
+ #include "connectiondetaileditor.h"
+ #include "ui_connectiondetaileditor.h"
+
++#include "settings/bondwidget.h"
++#include "settings/bridgewidget.h"
++#include "settings/btwidget.h"
++#include "settings/cdmawidget.h"
+ #include "settings/connectionwidget.h"
+-#include "settings/wiredconnectionwidget.h"
+-#include "settings/wificonnectionwidget.h"
++#include "settings/gsmwidget.h"
++#include "settings/infinibandwidget.h"
+ #include "settings/ipv4widget.h"
+ #include "settings/ipv6widget.h"
+-#include "settings/wifisecurity.h"
+-#include "settings/wiredsecurity.h"
+ #include "settings/pppwidget.h"
+ #include "settings/pppoewidget.h"
+-#include "settings/gsmwidget.h"
+-#include "settings/cdmawidget.h"
+-#include "settings/btwidget.h"
+-#include "settings/infinibandwidget.h"
+-#include "settings/bondwidget.h"
+-#include "settings/bridgewidget.h"
+ #include "settings/vlanwidget.h"
+ #include "settings/wimaxwidget.h"
+-#include "vpnuiplugin.h"
++#include "settings/wiredsecurity.h"
++#include "settings/wiredconnectionwidget.h"
++#include "settings/wifisecurity.h"
++#include "settings/wificonnectionwidget.h"
+ #include "vpn/openvpn/nm-openvpn-service.h"
++#include "vpnuiplugin.h"
+
+-#include <QDebug>
+-
+-#include <NetworkManagerQt/Settings>
+ #include <NetworkManagerQt/ActiveConnection>
++#include <NetworkManagerQt/AdslSetting>
++#include <NetworkManagerQt/CdmaSetting>
+ #include <NetworkManagerQt/Connection>
+-#include <NetworkManagerQt/WirelessSetting>
+-#include <NetworkManagerQt/VpnSetting>
+ #include <NetworkManagerQt/GenericTypes>
+-#include <NetworkManagerQt/WirelessDevice>
++#include <NetworkManagerQt/GsmSetting>
++#include <NetworkManagerQt/PppoeSetting>
++#include <NetworkManagerQt/Settings>
+ #include <NetworkManagerQt/Utils>
++#include <NetworkManagerQt/VpnSetting>
++#include <NetworkManagerQt/WirelessSetting>
++#include <NetworkManagerQt/WirelessDevice>
++
++#include <QDebug>
+
+ #include <KUser>
+ #include <KPluginFactory>
+@@ -66,7 +70,6 @@ ConnectionDetailEditor::ConnectionDetailEditor(NetworkManager::ConnectionSetting
+ QDialog(parent, f),
+ m_ui(new Ui::ConnectionDetailEditor),
+ m_connection(new NetworkManager::ConnectionSettings(type)),
+- m_numSecrets(0),
+ m_new(true),
+ m_masterUuid(masterUuid),
+ m_slaveType(slaveType)
+@@ -82,7 +85,6 @@ ConnectionDetailEditor::ConnectionDetailEditor(NetworkManager::ConnectionSetting
+ QDialog(parent, f),
+ m_ui(new Ui::ConnectionDetailEditor),
+ m_connection(new NetworkManager::ConnectionSettings(type)),
+- m_numSecrets(0),
+ m_new(true),
+ m_vpnType(vpnType)
+ {
+@@ -119,7 +121,6 @@ ConnectionDetailEditor::ConnectionDetailEditor(ConnectionSettings::ConnectionTyp
+ QDialog(parent, f),
+ m_ui(new Ui::ConnectionDetailEditor),
+ m_connection(new NetworkManager::ConnectionSettings(type)),
+- m_numSecrets(0),
+ m_new(true)
+ {
+ setAttribute(Qt::WA_DeleteOnClose);
+@@ -166,7 +167,6 @@ ConnectionDetailEditor::ConnectionDetailEditor(const NetworkManager::ConnectionS
+ QDialog(parent, f),
+ m_ui(new Ui::ConnectionDetailEditor),
+ m_connection(connection),
+- m_numSecrets(0),
+ m_new(newConnection),
+ m_masterUuid(connection->master()),
+ m_slaveType(connection->slaveType())
+@@ -190,46 +190,69 @@ void ConnectionDetailEditor::initEditor()
+ if (!m_new) {
+ NetworkManager::Connection::Ptr connection = NetworkManager::findConnectionByUuid(m_connection->uuid());
+ if (connection) {
++ bool hasSecrets = false;
+ connect(connection.data(), SIGNAL(gotSecrets(QString,bool,NMVariantMapMap,QString)),
+ SLOT(gotSecrets(QString,bool,NMVariantMapMap,QString)), Qt::UniqueConnection);
+
+- switch (m_connection->connectionType()) {
+- case ConnectionSettings::Adsl:
++ if (m_connection->connectionType() == NetworkManager::ConnectionSettings::Adsl) {
++ NetworkManager::AdslSetting::Ptr adslSetting = connection->settings()->setting(NetworkManager::Setting::Adsl).staticCast<NetworkManager::AdslSetting>();
++ if (adslSetting && !adslSetting->needSecrets().isEmpty()) {
++ hasSecrets = true;
+ connection->secrets("adsl");
+- m_numSecrets = 1;
+- break;
+- case ConnectionSettings::Bluetooth:
++ }
++ } else if (m_connection->connectionType() == NetworkManager::ConnectionSettings::Bluetooth) {
++ NetworkManager::GsmSetting::Ptr gsmSetting = connection->settings()->setting(NetworkManager::Setting::Gsm).staticCast<NetworkManager::GsmSetting>();
++ if (gsmSetting && !gsmSetting->needSecrets().isEmpty()) {
++ hasSecrets = true;
+ connection->secrets("gsm");
+- m_numSecrets = 1;
+- break;
+- case ConnectionSettings::Cdma:
++ }
++ } else if (m_connection->connectionType() == NetworkManager::ConnectionSettings::Cdma) {
++ NetworkManager::CdmaSetting::Ptr cdmaSetting = connection->settings()->setting(NetworkManager::Setting::Cdma).staticCast<NetworkManager::CdmaSetting>();
++ if (cdmaSetting && !cdmaSetting->needSecrets().isEmpty()) {
++ hasSecrets = true;
+ connection->secrets("cdma");
+- m_numSecrets = 1;
+- break;
+- case ConnectionSettings::Gsm:
++ }
++ } else if (m_connection->connectionType() == NetworkManager::ConnectionSettings::Gsm) {
++ NetworkManager::GsmSetting::Ptr gsmSetting = connection->settings()->setting(NetworkManager::Setting::Gsm).staticCast<NetworkManager::GsmSetting>();
++ if (gsmSetting && !gsmSetting->needSecrets().isEmpty()) {
++ hasSecrets = true;
+ connection->secrets("gsm");
+- m_numSecrets = 1;
+- break;
+- case ConnectionSettings::Pppoe:
++ }
++ } else if (m_connection->connectionType() == NetworkManager::ConnectionSettings::Pppoe) {
++ NetworkManager::PppoeSetting::Ptr pppoeSetting = connection->settings()->setting(NetworkManager::Setting::Pppoe).staticCast<NetworkManager::PppoeSetting>();
++ if (pppoeSetting && !pppoeSetting->needSecrets().isEmpty()) {
++ hasSecrets = true;
+ connection->secrets("pppoe");
+- m_numSecrets = 1;
+- break;
+- case ConnectionSettings::Wired:
+- connection->secrets("802-1x");
+- m_numSecrets = 1;
+- break;
+- case ConnectionSettings::Wireless:
++ }
++ } else if (m_connection->connectionType() == NetworkManager::ConnectionSettings::Wired) {
++ NetworkManager::Security8021xSetting::Ptr securitySetting = connection->settings()->setting(NetworkManager::Setting::Security8021x).staticCast<NetworkManager::Security8021xSetting>();
++ if (securitySetting && !securitySetting->needSecrets().isEmpty()) {
++ hasSecrets = true;
+ connection->secrets("802-1x");
+- connection->secrets("802-11-wireless-security");
+- m_numSecrets = 2;
+- break;
+- case ConnectionSettings::Vpn:
+- connection->secrets("vpn");
+- m_numSecrets = 1;
+- break;
+- default:
+- initTabs();
+- break;
++ }
++ } else if (m_connection->connectionType() == NetworkManager::ConnectionSettings::Wireless) {
++ NetworkManager::WirelessSecuritySetting::Ptr wifiSecuritySetting = connection->settings()->setting(NetworkManager::Setting::WirelessSecurity).staticCast<NetworkManager::WirelessSecuritySetting>();
++ if (wifiSecuritySetting &&
++ (wifiSecuritySetting->keyMgmt() == NetworkManager::WirelessSecuritySetting::WpaEap ||
++ wifiSecuritySetting->keyMgmt() == NetworkManager::WirelessSecuritySetting::WirelessSecuritySetting::Ieee8021x)) {
++ NetworkManager::Security8021xSetting::Ptr securitySetting = connection->settings()->setting(NetworkManager::Setting::Security8021x).staticCast<NetworkManager::Security8021xSetting>();
++ if (securitySetting && !securitySetting->needSecrets().isEmpty()) {
++ hasSecrets = true;
++ connection->secrets("802-1x");
++ }
++ } else {
++ if (!wifiSecuritySetting->needSecrets().isEmpty()) {
++ hasSecrets = true;
++ connection->secrets("802-11-wireless-security");
++ }
++ }
++ } else if (m_connection->connectionType() == NetworkManager::ConnectionSettings::Vpn) {
++ hasSecrets = true;
++ connection->secrets("vpn");
++ }
++
++ if (!hasSecrets) {
++ initTabs();
+ }
+ }
+ } else {
+@@ -475,24 +498,14 @@ void ConnectionDetailEditor::connectionAddComplete(const QString& id, bool succe
+
+ void ConnectionDetailEditor::gotSecrets(const QString& id, bool success, const NMVariantMapMap& secrets, const QString& msg)
+ {
+- if (id == m_connection->uuid()) {
+- m_numSecrets--;
+- } else {
+- return;
+- }
+-
+- if (success) {
++ if (id == m_connection->uuid() && success) {
+ foreach (const QString & key, secrets.keys()) {
+ NetworkManager::Setting::Ptr setting = m_connection->setting(NetworkManager::Setting::typeFromString(key));
+ setting->secretsFromMap(secrets.value(key));
+ }
+- } else {
+- qDebug() << msg;
+ }
+
+- if (!m_numSecrets) {
+- initTabs();
+- }
++ initTabs();
+ }
+
+ void ConnectionDetailEditor::disconnectSignals()
+diff --git a/libs/editor/connectiondetaileditor.h b/libs/editor/connectiondetaileditor.h
+index b7f3e3b..64c8890 100644
+--- a/libs/editor/connectiondetaileditor.h
++++ b/libs/editor/connectiondetaileditor.h
+@@ -68,7 +68,6 @@ private:
+
+ Ui::ConnectionDetailEditor * m_ui;
+ NetworkManager::ConnectionSettings::Ptr m_connection;
+- int m_numSecrets;
+ bool m_new;
+ QString m_vpnType;
+ QString m_masterUuid;
diff --git a/plasma-nm-update-tray-icon-even-after-small-signal-drop-increase.patch b/plasma-nm-update-tray-icon-even-after-small-signal-drop-increase.patch
new file mode 100644
index 0000000..405300e
--- /dev/null
+++ b/plasma-nm-update-tray-icon-even-after-small-signal-drop-increase.patch
@@ -0,0 +1,76 @@
+diff --git a/libs/declarative/connectionicon.cpp b/libs/declarative/connectionicon.cpp
+index 03dc319..b1678ca 100644
+--- a/libs/declarative/connectionicon.cpp
++++ b/libs/declarative/connectionicon.cpp
+@@ -567,41 +567,34 @@ void ConnectionIcon::setWirelessIcon(const NetworkManager::Device::Ptr &device,
+
+ void ConnectionIcon::setWirelessIconForSignalStrength(int strength)
+ {
+- const int diff = m_signal - strength;
+-
+- if (diff >= 10 || diff <= -10) {
+- int iconStrength = 100;
+-
+- if (strength == 0) {
+- iconStrength = 0;
+- m_connectionTooltipIcon = "network-wireless-connected-00";
+- Q_EMIT connectionTooltipIconChanged("network-wireless-connected-00");
+- } else if (strength < 20) {
+- iconStrength = 20;
+- m_connectionTooltipIcon = "network-wireless-connected-20";
+- Q_EMIT connectionTooltipIconChanged("network-wireless-connected-20");
+- } else if (strength < 40) {
+- iconStrength = 40;
+- m_connectionTooltipIcon = "network-wireless-connected-40";
+- Q_EMIT connectionTooltipIconChanged("network-wireless-connected-40");
+- } else if (strength < 60) {
+- iconStrength = 60;
+- m_connectionTooltipIcon = "network-wireless-connected-60";
+- Q_EMIT connectionTooltipIconChanged("network-wireless-connected-60");
+- } else if (strength < 80) {
+- iconStrength = 80;
+- m_connectionTooltipIcon = "network-wireless-connected-80";
+- Q_EMIT connectionTooltipIconChanged("network-wireless-connected-80");
+- } else if (strength < 100) {
+- m_connectionTooltipIcon = "network-wireless-connected-100";
+- Q_EMIT connectionTooltipIconChanged("network-wireless-connected-100");
+- }
+-
+- m_signal = iconStrength;
+-
+- QString icon = QString("network-wireless-%1").arg(iconStrength);
+-
+- m_connectionIcon = icon;
+- Q_EMIT connectionIconChanged(icon);
+- }
++ int iconStrength = 100;
++ if (strength == 0) {
++ iconStrength = 0;
++ m_connectionTooltipIcon = "network-wireless-connected-00";
++ Q_EMIT connectionTooltipIconChanged("network-wireless-connected-00");
++ } else if (strength < 20) {
++ iconStrength = 20;
++ m_connectionTooltipIcon = "network-wireless-connected-20";
++ Q_EMIT connectionTooltipIconChanged("network-wireless-connected-20");
++ } else if (strength < 40) {
++ iconStrength = 40;
++ m_connectionTooltipIcon = "network-wireless-connected-40";
++ Q_EMIT connectionTooltipIconChanged("network-wireless-connected-40");
++ } else if (strength < 60) {
++ iconStrength = 60;
++ m_connectionTooltipIcon = "network-wireless-connected-60";
++ Q_EMIT connectionTooltipIconChanged("network-wireless-connected-60");
++ } else if (strength < 80) {
++ iconStrength = 80;
++ m_connectionTooltipIcon = "network-wireless-connected-80";
++ Q_EMIT connectionTooltipIconChanged("network-wireless-connected-80");
++ } else if (strength < 100) {
++ m_connectionTooltipIcon = "network-wireless-connected-100";
++ Q_EMIT connectionTooltipIconChanged("network-wireless-connected-100");
++ }
++
++ QString icon = QString("network-wireless-%1").arg(iconStrength);
++
++ m_connectionIcon = icon;
++ Q_EMIT connectionIconChanged(icon);
+ }
diff --git a/plasma-nm-use-proper-kded-service-name.patch b/plasma-nm-use-proper-kded-service-name.patch
new file mode 100644
index 0000000..d107544
--- /dev/null
+++ b/plasma-nm-use-proper-kded-service-name.patch
@@ -0,0 +1,13 @@
+diff --git a/libs/handler.cpp b/libs/handler.cpp
+index cb8e71f..d3c1454 100644
+--- a/libs/handler.cpp
++++ b/libs/handler.cpp
+@@ -53,7 +53,7 @@ Handler::Handler(QObject* parent)
+ , m_tmpWimaxEnabled(NetworkManager::isWimaxEnabled())
+ , m_tmpWirelessEnabled(NetworkManager::isWirelessEnabled())
+ , m_tmpWwanEnabled(NetworkManager::isWwanEnabled())
+- , m_agentIface(QStringLiteral("org.kde.kded5"), QStringLiteral("/modules/networkmanagement"),
++ , m_agentIface(QStringLiteral("org.kde.kded"), QStringLiteral("/modules/networkmanagement"),
+ QStringLiteral("org.kde.plasmanetworkmanagement"))
+ {
+ m_agentIface.call(QStringLiteral("init"));
diff --git a/plasma-nm-watch-for-ipinterface-change.patch b/plasma-nm-watch-for-ipinterface-change.patch
new file mode 100644
index 0000000..8911655
--- /dev/null
+++ b/plasma-nm-watch-for-ipinterface-change.patch
@@ -0,0 +1,54 @@
+diff --git a/libs/models/networkmodel.cpp b/libs/models/networkmodel.cpp
+index 23784b1..63f6542 100644
+--- a/libs/models/networkmodel.cpp
++++ b/libs/models/networkmodel.cpp
+@@ -214,6 +214,8 @@ void NetworkModel::initializeSignals(const NetworkManager::Device::Ptr& device)
+ SLOT(ipConfigChanged()), Qt::UniqueConnection);
+ connect(device.data(), SIGNAL(ipV6ConfigChanged()),
+ SLOT(ipConfigChanged()), Qt::UniqueConnection);
++ connect(device.data(), SIGNAL(ipInterfaceChanged()),
++ SLOT(ipInterfaceChanged()));
+ connect(device.data(), SIGNAL(stateChanged(NetworkManager::Device::State,NetworkManager::Device::State,NetworkManager::Device::StateChangeReason)),
+ SLOT(deviceStateChanged(NetworkManager::Device::State,NetworkManager::Device::State,NetworkManager::Device::StateChangeReason)), Qt::UniqueConnection);
+
+@@ -912,6 +914,7 @@ void NetworkModel::gsmNetworkSignalQualityChanged(uint signal)
+ }
+ }
+ }
++
+ #endif
+
+ void NetworkModel::ipConfigChanged()
+@@ -926,6 +929,20 @@ void NetworkModel::ipConfigChanged()
+ }
+ }
+
++void NetworkModel::ipInterfaceChanged()
++{
++ NetworkManager::Device * device = qobject_cast<NetworkManager::Device*>(sender());
++ if (device) {
++ foreach (NetworkModelItem * item, m_list.returnItems(NetworkItemsList::Device, device->uni())) {
++ if (device->ipInterfaceName().isEmpty()) {
++ item->setDeviceName(device->interfaceName());
++ } else {
++ item->setDeviceName(device->ipInterfaceName());
++ }
++ }
++ }
++}
++
+ void NetworkModel::statusChanged(NetworkManager::Status status)
+ {
+ Q_UNUSED(status);
+diff --git a/libs/models/networkmodel.h b/libs/models/networkmodel.h
+index c718d74..e228286 100644
+--- a/libs/models/networkmodel.h
++++ b/libs/models/networkmodel.h
+@@ -100,6 +100,7 @@ private Q_SLOTS:
+ void gsmNetworkSignalQualityChanged(uint signal);
+ #endif
+ void ipConfigChanged();
++ void ipInterfaceChanged();
+ void statusChanged(NetworkManager::Status status);
+ void wimaxNspAppeared(const QString& nsp);
+ void wimaxNspDisappeared(const QString& nsp);
diff --git a/sources b/sources
index adbce8f..28c3fd6 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-e261981801fb46ad3304877b076e91b7 plasma-nm-0.9.3.4.tar.xz
+a3bd2f91d687685008cfbddda3e87909 plasma-nm-0.9.3.4.tar.xz
More information about the scm-commits
mailing list