You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kf5-networkmanager-qt/nm-qt-set-auto-negotiation-...

45 lines
1.3 KiB

From d039943788dd08a5e2b1611732e3cfb6c2f64f26 Mon Sep 17 00:00:00 2001
From: Jan Grulich <jgrulich@redhat.com>
Date: Wed, 12 Apr 2017 14:02:19 +0200
Subject: Set default value for auto-negotiation based on running NM version
When running NM 1.6.0 and newer the default value is false, while previous
versions used to set it to true.
---
src/settings/wiredsetting.cpp | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/settings/wiredsetting.cpp b/src/settings/wiredsetting.cpp
index d366f31..8fb3659 100644
--- a/src/settings/wiredsetting.cpp
+++ b/src/settings/wiredsetting.cpp
@@ -20,6 +20,7 @@
#include "wiredsetting.h"
#include "wiredsetting_p.h"
+#include "manager.h"
#if !NM_CHECK_VERSION(1, 0, 0)
#include <nm-setting-wired.h>
@@ -32,10 +33,16 @@ NetworkManager::WiredSettingPrivate::WiredSettingPrivate()
, port(NetworkManager::WiredSetting::UnknownPort)
, speed(0)
, duplex(NetworkManager::WiredSetting::UnknownDuplexType)
- , autoNegotiate(false)
+ // , autonegotiate(false)
, mtu(0)
, s390NetType(NetworkManager::WiredSetting::Undefined)
-{ }
+{
+ if (NetworkManager::checkVersion(1, 6, 0)) {
+ autoNegotiate = false;
+ } else {
+ autoNegotiate = true;
+ }
+}
NetworkManager::WiredSetting::WiredSetting()
: Setting(Setting::Wired)
--
cgit v0.11.2