[kde-runtime] Fix automount when explicit Unknown Mount removable option is selected (#1012080)

Rex Dieter rdieter at fedoraproject.org
Wed Sep 25 16:38:27 UTC 2013


commit fdf3aef31e1cb3f2e9d772f5151bae3ac6f341a8
Author: Rex Dieter <rdieter at math.unl.edu>
Date:   Wed Sep 25 11:38:18 2013 -0500

    Fix automount when explicit Unknown Mount removable option is selected (#1012080)

 ...nknown-device-option-has-wrong-logic-and-.patch |   87 ++++++++++++++++++++
 kde-runtime.spec                                   |    8 ++-
 2 files changed, 94 insertions(+), 1 deletions(-)
---
diff --git a/Automount-Unknown-device-option-has-wrong-logic-and-.patch b/Automount-Unknown-device-option-has-wrong-logic-and-.patch
new file mode 100644
index 0000000..99a92bb
--- /dev/null
+++ b/Automount-Unknown-device-option-has-wrong-logic-and-.patch
@@ -0,0 +1,87 @@
+From c0681052c7d026507f799ea287fcaa3b4b9187ae Mon Sep 17 00:00:00 2001
+From: Helio Chissini de Castro <helio at kde.org>
+Date: Wed, 25 Sep 2013 11:59:45 -0300
+Subject: [PATCH] - Automount Unknown device option has wrong logic, and the
+ only way to   make automount is by having a known device, turning the  
+ AutomountUnknownDevices option useless. Detected by  
+ george.tavares at sabiaexperience.com.br
+
+---
+ solid-device-automounter/kcm/DeviceAutomounterKCM.cpp | 8 ++++----
+ solid-device-automounter/kded/DeviceAutomounter.cpp   | 5 ++++-
+ solid-device-automounter/lib/AutomounterSettings.cpp  | 4 +---
+ 3 files changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/solid-device-automounter/kcm/DeviceAutomounterKCM.cpp b/solid-device-automounter/kcm/DeviceAutomounterKCM.cpp
+index 42fbfae..d5ece6b 100644
+--- a/solid-device-automounter/kcm/DeviceAutomounterKCM.cpp
++++ b/solid-device-automounter/kcm/DeviceAutomounterKCM.cpp
+@@ -130,9 +130,9 @@ DeviceAutomounterKCM::load()
+         automountEnabled->setCheckState(Qt::Unchecked);
+ 
+     if (AutomounterSettings::automountUnknownDevices())
+-        automountUnknownDevices->setCheckState(Qt::Unchecked);
+-    else
+         automountUnknownDevices->setCheckState(Qt::Checked);
++    else
++        automountUnknownDevices->setCheckState(Qt::Unchecked);
+ 
+     if (AutomounterSettings::automountOnLogin())
+         automountOnLogin->setCheckState(Qt::Checked);
+@@ -159,9 +159,9 @@ DeviceAutomounterKCM::save()
+         AutomounterSettings::setAutomountEnabled(false);
+ 
+     if (this->automountUnknownDevices->checkState() == Qt::Checked)
+-        AutomounterSettings::setAutomountUnknownDevices(false);
+-    else
+         AutomounterSettings::setAutomountUnknownDevices(true);
++    else
++        AutomounterSettings::setAutomountUnknownDevices(false);
+ 
+     if (this->automountOnLogin->checkState() == Qt::Checked)
+         AutomounterSettings::setAutomountOnLogin(true);
+diff --git a/solid-device-automounter/kded/DeviceAutomounter.cpp b/solid-device-automounter/kded/DeviceAutomounter.cpp
+index 9939c96..14b4e87 100644
+--- a/solid-device-automounter/kded/DeviceAutomounter.cpp
++++ b/solid-device-automounter/kded/DeviceAutomounter.cpp
+@@ -76,7 +76,10 @@ DeviceAutomounter::automountDevice(Solid::Device &dev, AutomounterSettings::Auto
+         AutomounterSettings::setDeviceLastSeenMounted(dev.udi(), sa->isAccessible());
+         AutomounterSettings::saveDevice(dev);
+ 		kDebug() << "Saving as" << dev.description();
+-        if (AutomounterSettings::shouldAutomountDevice(dev.udi(), type)) {
++        if (!AutomounterSettings::automountUnknownDevices()) {
++			if(!AutomounterSettings::shouldAutomountDevice(dev.udi(), type)) {
++				return;
++			}
+             Solid::StorageVolume *sv = dev.as<Solid::StorageVolume>();
+             if (!sv->isIgnored()) {
+                 kDebug() << "Mounting" << dev.udi();
+diff --git a/solid-device-automounter/lib/AutomounterSettings.cpp b/solid-device-automounter/lib/AutomounterSettings.cpp
+index 87860da..2b3e6be 100644
+--- a/solid-device-automounter/lib/AutomounterSettings.cpp
++++ b/solid-device-automounter/lib/AutomounterSettings.cpp
+@@ -63,7 +63,6 @@ AutomounterSettings::shouldAutomountDevice(const QString &udi, AutomountType typ
+      */
+     bool known = deviceIsKnown(udi);
+     bool enabled = automountEnabled();
+-    bool automountKnown = !automountUnknownDevices();
+     bool deviceAutomount = deviceAutomountIsForced(udi, type);
+     bool lastSeenMounted = deviceSettings(udi).readEntry("LastSeenMounted", false);
+     bool typeCondition = false;
+@@ -75,12 +74,11 @@ AutomounterSettings::shouldAutomountDevice(const QString &udi, AutomountType typ
+             typeCondition = automountOnPlugin();
+             break;
+     }
+-    bool shouldAutomount = deviceAutomount || (enabled && typeCondition && ((automountKnown && known) || lastSeenMounted));
++    bool shouldAutomount = deviceAutomount || (enabled && typeCondition && (known || lastSeenMounted));
+ 
+     kDebug() << "Processing" << udi;
+     kDebug() << "type:" << type;
+     kDebug() << "typeCondition:" << typeCondition;
+-    kDebug() << "automountKnownDevices:" << automountKnown;
+     kDebug() << "deviceIsKnown:" << known;
+     kDebug() << "AutomountEnabled:" << enabled;
+     kDebug() << "Automount:" << deviceAutomount;
+-- 
+1.8.3.1
+
diff --git a/kde-runtime.spec b/kde-runtime.spec
index 0090ef4..b2edefc 100644
--- a/kde-runtime.spec
+++ b/kde-runtime.spec
@@ -6,7 +6,7 @@
 Name:    kde-runtime
 Summary: KDE Runtime
 Version: 4.11.1
-Release: 2%{?dist}
+Release: 3%{?dist}
 
 # http://techbase.kde.org/Policies/Licensing_Policy
 License: LGPLv2+ and GPLv2+
@@ -65,6 +65,8 @@ Patch53: kde-runtime-initial_passwordless_kwallet_option.patch
 ## upstream patches
 # https://bugs.kde.org/show_bug.cgi?id=254198
 Patch100: Fix-the-synchronous-mode-wallet-open-logic.patch
+# backport from master branch
+Patch101: Automount-Unknown-device-option-has-wrong-logic-and-.patch
 
 # rhel patches
 Patch300: kde-runtime-4.9.2-webkit.patch
@@ -204,6 +206,7 @@ Requires: %{name} = %{version}-%{release}
 %patch52 -p1 -b .mouseeventlistener
 %patch53 -p1 -b .initial_passwordless_kwallet_option
 %patch100 -p1 -b .Fix-the-synchronous-mode-wallet-open-logic
+%patch101 -p1 -b .Automount-Unknown-device-option-has-wrong-logic
 
 %if ! 0%{?webkit}
 %patch300 -p1 -b .webkit
@@ -421,6 +424,9 @@ fi
 
 
 %changelog
+* Wed Sep 25 2013 Rex Dieter <rdieter at fedoraproject.org> 4.11.1-3
+- Fix automount when explicit Unknown Mount removable option is selected (#1012080)
+
 * Mon Sep 09 2013 Rex Dieter <rdieter at fedoraproject.org> 4.11.1-2
 - rebuild (openexr)
 


More information about the scm-commits mailing list