[Pkg-utopia-commits] r86 - in packages/gnome-volume-manager/trunk/debian: . patches
Sjoerd Simons
sjoerd@haydn.debian.org
Wed, 17 Nov 2004 08:14:29 -0700
Author: sjoerd
Date: 2004-11-17 08:14:14 -0700 (Wed, 17 Nov 2004)
New Revision: 86
Added:
packages/gnome-volume-manager/trunk/debian/patches/04_honor_automount_enabled_hint.patch
Modified:
packages/gnome-volume-manager/trunk/debian/changelog
Log:
honor hal's automount_enabled_hint
Modified: packages/gnome-volume-manager/trunk/debian/changelog
===================================================================
--- packages/gnome-volume-manager/trunk/debian/changelog 2004-11-17 15:06:32 UTC (rev 85)
+++ packages/gnome-volume-manager/trunk/debian/changelog 2004-11-17 15:14:14 UTC (rev 86)
@@ -12,8 +12,11 @@
+ Added. Merge all the gconf schema patches into one patch.
Also turn autorun off and autobrowse on by default.
* debian/patches/00_default_dvd.patch
+ + Removed. Obsoleted by debian/patches/00_set_defaults.patch
* debian/patches/07_default_photo_command.patch
+ Removed. Obsoleted by debian/patches/00_set_defaults.patch
+ * debian/patches/04_honor_automount_enabled_hint.patch
+ + Added. honor hal's storage.automount_enabled_hint property
-- Sjoerd Simons <sjoerd@debian.org> Wed, 17 Nov 2004 11:44:57 +0100
Added: packages/gnome-volume-manager/trunk/debian/patches/04_honor_automount_enabled_hint.patch
===================================================================
--- packages/gnome-volume-manager/trunk/debian/patches/04_honor_automount_enabled_hint.patch 2004-11-17 15:06:32 UTC (rev 85)
+++ packages/gnome-volume-manager/trunk/debian/patches/04_honor_automount_enabled_hint.patch 2004-11-17 15:14:14 UTC (rev 86)
@@ -0,0 +1,84 @@
+diff -ruN gnome-volume-manager-old/src/manager.c gnome-volume-manager/src/manager.c
+--- gnome-volume-manager-old/src/manager.c 2004-11-17 16:08:35.396027000 +0100
++++ gnome-volume-manager/src/manager.c 2004-11-17 16:09:38.532745793 +0100
+@@ -245,6 +245,26 @@
+ return retval;
+ }
+
++/* Returns true if the storage policy indicates this should be manually
++ * mounted */
++static gboolean
++gvm_is_manual_mount(LibHalContext *ctx, const char *udi) {
++ gchar *parent;
++ gboolean ret = FALSE;
++
++ parent = hal_device_get_property_string(ctx, udi, "info.parent");
++ if (hal_device_property_exists (hal_ctx, parent,
++ "storage.automount_enabled_hint")) {
++ ret = !hal_device_get_property_bool (hal_ctx, parent,
++ "storage.automount_enabled_hint");
++ }
++ if (hal_device_property_exists (hal_ctx, udi,
++ "storage.automount_enabled_hint")) {
++ ret = !hal_device_get_property_bool (hal_ctx, udi,
++ "storage.automount_enabled_hint");
++ }
++ return ret;
++}
+ /*
+ * gvm_check_dvd - is this a Video DVD? If so, do something about it.
+ *
+@@ -622,6 +642,8 @@
+
+ switch (action) {
+ case MOUNT:
++ if (gvm_is_manual_mount(hal_ctx, udi))
++ break;
+ gvm_device_mount (device);
+ mounted_volumes_policy_queue = g_slist_append (mounted_volumes_policy_queue, g_strdup (udi));
+ break;
+@@ -698,7 +720,7 @@
+ } else if (has_audio && has_data) {
+ gvm_ask_mixed (udi);
+ } else if (has_data) {
+- if (config.automount_media) {
++ if (config.automount_media && !gvm_is_manual_mount(hal_ctx, udi)) {
+ gvm_device_mount (device);
+ mounted_volumes_policy_queue = g_slist_append (mounted_volumes_policy_queue, g_strdup (udi));
+ }
+@@ -756,9 +778,10 @@
+ } else {
+ dbg ("Added: %s\n", device);
+
+- if (config.automount_drives) {
++ if (config.automount_drives && !gvm_is_manual_mount(hal_ctx, udi)) {
+ gvm_device_mount (device);
+- mounted_volumes_policy_queue = g_slist_append (mounted_volumes_policy_queue, g_strdup (udi));
++ mounted_volumes_policy_queue =
++ g_slist_append (mounted_volumes_policy_queue, g_strdup (udi));
+ }
+ }
+
+@@ -820,9 +843,10 @@
+ /* folks, we have a new device! */
+ dbg ("Added: %s\n", device);
+
+- if (config.automount_drives) {
++ if (config.automount_drives && !gvm_is_manual_mount(ctx, udi)) {
+ gvm_device_mount (device);
+- mounted_volumes_policy_queue = g_slist_append (mounted_volumes_policy_queue, g_strdup (udi));
++ mounted_volumes_policy_queue =
++ g_slist_append (mounted_volumes_policy_queue, g_strdup (udi));
+ }
+
+ out:
+@@ -1031,6 +1055,9 @@
+ "volume.fsusage"),
+ "filesystem") != 0)
+ continue;
++ /* only automagically mount when manual_mount is not specified */
++ if (gvm_is_manual_mount(ctx, udi))
++ continue;
+
+ device_file = hal_device_get_property_string (ctx, udi,
+ "block.device");