- Don't show drives that are supposed to be hidden (#498649)

- Only automount if media or drive was just inserted - this fixes a problem
    with spurious automounts when partitioning/formatting
This commit is contained in:
David Zeuthen 2009-05-02 13:26:47 +00:00
parent 109d2c0160
commit 3d17b00fc4
3 changed files with 103 additions and 1 deletions

View File

@ -0,0 +1,59 @@
From 3f3f21fe6e2bdac8fd6acf048da6fb228adde092 Mon Sep 17 00:00:00 2001
From: David Zeuthen <davidz@redhat.com>
Date: Fri, 01 May 2009 19:59:54 +0000
Subject: Use new gnome-disk-utility API to figure out when media was inserted
This fixes a problem with Nautilus automounting newly created volumes
appearing as a result of formatting/partitioning.
---
diff --git a/monitor/gdu/ggdudrive.c b/monitor/gdu/ggdudrive.c
index 29e108d..c2c8b76 100644
--- a/monitor/gdu/ggdudrive.c
+++ b/monitor/gdu/ggdudrive.c
@@ -51,7 +51,6 @@ struct _GGduDrive {
gboolean can_eject;
gboolean can_poll_for_media;
gboolean is_media_check_automatic;
- time_t time_of_last_media_insertion;
};
static void g_gdu_drive_drive_iface_init (GDriveIface *iface);
@@ -178,9 +177,6 @@ update_drive (GGduDrive *drive)
if (device != NULL)
g_object_unref (device);
- if (drive->has_media != old_has_media)
- drive->time_of_last_media_insertion = time (NULL);
-
/* compute whether something changed */
changed = !((old_is_media_removable == drive->is_media_removable) &&
(old_has_media == drive->has_media) &&
@@ -233,8 +229,6 @@ g_gdu_drive_new (GVolumeMonitor *volume_monitor,
drive->presentable = g_object_ref (presentable);
- drive->time_of_last_media_insertion = time (NULL);
-
g_signal_connect (drive->presentable, "changed", G_CALLBACK (presentable_changed), drive);
g_signal_connect (drive->presentable, "job-changed", G_CALLBACK (presentable_job_changed), drive);
@@ -685,7 +679,16 @@ g_gdu_drive_has_presentable (GGduDrive *drive,
time_t
g_gdu_drive_get_time_of_last_media_insertion (GGduDrive *drive)
{
- return drive->time_of_last_media_insertion;
+ GduDevice *device;
+ time_t ret;
+
+ ret = 0;
+ device = gdu_presentable_get_device (drive->presentable);
+ if (device != NULL) {
+ ret = gdu_device_get_media_detection_time (device);
+ g_object_unref (device);
+ }
+ return ret;
}
GduPresentable *
--
cgit v0.8.2

View File

@ -0,0 +1,29 @@
From 59dd3b33a71a930651f23142e2a7d7e57727144f Mon Sep 17 00:00:00 2001
From: David Zeuthen <davidz@redhat.com>
Date: Fri, 01 May 2009 21:23:01 +0000
Subject: Fix bug where drives are not ignored as they ought to be
This should fix part of
https://bugzilla.redhat.com/show_bug.cgi?id=498649#c14
(the other part is fixed in the Fedora livecd scripts)
---
diff --git a/monitor/gdu/ggduvolumemonitor.c b/monitor/gdu/ggduvolumemonitor.c
index 2c1f727..df42249 100644
--- a/monitor/gdu/ggduvolumemonitor.c
+++ b/monitor/gdu/ggduvolumemonitor.c
@@ -833,8 +833,10 @@ should_drive_be_ignored (GduPool *pool, GduDrive *d, GList *fstab_mount_points)
goto out;
}
- if (gdu_device_get_presentation_hide (device))
+ if (gdu_device_get_presentation_hide (device)) {
+ ignored = TRUE;
goto out;
+ }
has_volumes = FALSE;
all_volumes_are_ignored = TRUE;
--
cgit v0.8.2

View File

@ -1,7 +1,7 @@
Summary: Backends for the gio framework in GLib Summary: Backends for the gio framework in GLib
Name: gvfs Name: gvfs
Version: 1.2.2 Version: 1.2.2
Release: 3%{?dist} Release: 4%{?dist}
License: LGPLv2+ License: LGPLv2+
Group: System Environment/Libraries Group: System Environment/Libraries
URL: http://www.gtk.org URL: http://www.gtk.org
@ -39,6 +39,8 @@ Patch4: gvfs-1.2.2-ssh-auth-sock.patch
# Gdu volume monitor patches, from http://cgit.freedesktop.org/~david/gvfs/log/?h=gdu-volume-monitor # Gdu volume monitor patches, from http://cgit.freedesktop.org/~david/gvfs/log/?h=gdu-volume-monitor
# #
# These are all in gvfs' master branch on git.gnome.org.
#
# http://bugzilla.gnome.org/show_bug.cgi?id=573826 # http://bugzilla.gnome.org/show_bug.cgi?id=573826
Patch101: gdu-0001-Bug-573826-gdu-volume-monitor.patch Patch101: gdu-0001-Bug-573826-gdu-volume-monitor.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=573826 # http://bugzilla.gnome.org/show_bug.cgi?id=573826
@ -65,6 +67,11 @@ Patch111: gdu-0011-Bug-576083-pre-unmount-signals-not-being-trigger.patch
Patch112: gdu-0012-use-new-gnome-disk-utility-API-to-hide-unwanted-devi.patch Patch112: gdu-0012-use-new-gnome-disk-utility-API-to-hide-unwanted-devi.patch
Patch113: gdu-0013-pass-the-flush-mount-option-for-vfat.patch Patch113: gdu-0013-pass-the-flush-mount-option-for-vfat.patch
# Only automount when media has just been inserted
Patch114: 0014-gvfs-use-device-media-detected.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=498649
Patch115: 0015-gvfs-respect-presentation-hide-for-drives.patch
%description %description
The gvfs package provides backend implementations for the gio The gvfs package provides backend implementations for the gio
framework in GLib. It includes ftp, sftp, cifs. framework in GLib. It includes ftp, sftp, cifs.
@ -163,6 +170,8 @@ media players (Media Transfer Protocol) to applications using gvfs.
%patch111 -p1 -b .gdu-pre-unmount-signals %patch111 -p1 -b .gdu-pre-unmount-signals
%patch112 -p1 -b .gdu-unwanted-devices %patch112 -p1 -b .gdu-unwanted-devices
%patch113 -p1 -b .gdu-vfat-flush %patch113 -p1 -b .gdu-vfat-flush
%patch114 -p1 -b .gdu-automount-only-on-insertion
%patch115 -p1 -b .gdu-hide-drives
%build %build
@ -306,6 +315,11 @@ update-desktop-database &> /dev/null ||:
%changelog %changelog
* Sat May 02 2009 David Zeuthen <davidz@redhat.com> - 1.2.2-4
- Don't show drives that are supposed to be hidden (#498649)
- Only automount if media or drive was just inserted - this fixes
a problem with spurious automounts when partitioning/formatting
* Wed Apr 15 2009 David Zeuthen <davidz@redhat.com> - 1.2.2-3 * Wed Apr 15 2009 David Zeuthen <davidz@redhat.com> - 1.2.2-3
- Sync with the gdu-volume-monitor branch - Sync with the gdu-volume-monitor branch