nautilus r14953 - in trunk: . libnautilus-private src src/file-manager
- From: alexl svn gnome org
- To: svn-commits-list gnome org
- Subject: nautilus r14953 - in trunk: . libnautilus-private src src/file-manager
- Date: Mon, 16 Feb 2009 10:07:55 +0000 (UTC)
Author: alexl
Date: Mon Feb 16 10:07:54 2009
New Revision: 14953
URL: http://svn.gnome.org/viewvc/nautilus?rev=14953&view=rev
Log:
2009-02-10 David Zeuthen <davidz redhat com>
Don't use shadowed mounts.
* libnautilus-private/nautilus-desktop-link-monitor.c (has_mount),
(create_mount_link), (remove_mount_link), (mount_added_callback),
(mount_removed_callback), (mount_changed_callback):
* libnautilus-private/nautilus-directory-async.c (get_mount_at):
* src/file-manager/fm-tree-view.c (add_root_for_mount):
* src/nautilus-pathbar.c (is_file_path_mounted_mount):
* src/nautilus-places-sidebar.c (update_places):
Honor g_mount_is_shadowed().
Modified:
trunk/ChangeLog
trunk/libnautilus-private/nautilus-desktop-link-monitor.c
trunk/libnautilus-private/nautilus-directory-async.c
trunk/src/file-manager/fm-tree-view.c
trunk/src/nautilus-pathbar.c
trunk/src/nautilus-places-sidebar.c
Modified: trunk/libnautilus-private/nautilus-desktop-link-monitor.c
==============================================================================
--- trunk/libnautilus-private/nautilus-desktop-link-monitor.c (original)
+++ trunk/libnautilus-private/nautilus-desktop-link-monitor.c Mon Feb 16 10:07:54 2009
@@ -182,35 +182,48 @@
return unique_name;
}
+static gboolean
+has_mount (NautilusDesktopLinkMonitor *monitor,
+ GMount *mount)
+{
+ gboolean ret;
+ GMount *other_mount;
+ GList *l;
+
+ ret = FALSE;
+
+ for (l = monitor->details->mount_links; l != NULL; l = l->next) {
+ other_mount = nautilus_desktop_link_get_mount (l->data);
+ if (mount == other_mount) {
+ g_object_unref (other_mount);
+ ret = TRUE;
+ break;
+ }
+ g_object_unref (other_mount);
+ }
+
+ return ret;
+}
+
static void
create_mount_link (NautilusDesktopLinkMonitor *monitor,
GMount *mount)
{
NautilusDesktopLink *link;
- link = NULL;
+ if (has_mount (monitor, mount))
+ return;
- if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_DESKTOP_VOLUMES_VISIBLE)) {
+ if ((!g_mount_is_shadowed (mount)) &&
+ eel_preferences_get_boolean (NAUTILUS_PREFERENCES_DESKTOP_VOLUMES_VISIBLE)) {
link = nautilus_desktop_link_new_from_mount (mount);
monitor->details->mount_links = g_list_prepend (monitor->details->mount_links, link);
}
}
-
-
static void
-mount_added_callback (GVolumeMonitor *volume_monitor,
- GMount *mount,
- NautilusDesktopLinkMonitor *monitor)
-{
- create_mount_link (monitor, mount);
-}
-
-
-static void
-mount_removed_callback (GVolumeMonitor *volume_monitor,
- GMount *mount,
- NautilusDesktopLinkMonitor *monitor)
+remove_mount_link (NautilusDesktopLinkMonitor *monitor,
+ GMount *mount)
{
GList *l;
NautilusDesktopLink *link;
@@ -233,15 +246,38 @@
}
}
+
+
static void
-mount_changed_callback (GVolumeMonitor *volume_monitor,
+mount_added_callback (GVolumeMonitor *volume_monitor,
+ GMount *mount,
+ NautilusDesktopLinkMonitor *monitor)
+{
+ create_mount_link (monitor, mount);
+}
+
+
+static void
+mount_removed_callback (GVolumeMonitor *volume_monitor,
GMount *mount,
NautilusDesktopLinkMonitor *monitor)
{
- /* TODO: update the mount */
+ remove_mount_link (monitor, mount);
}
static void
+mount_changed_callback (GVolumeMonitor *volume_monitor,
+ GMount *mount,
+ NautilusDesktopLinkMonitor *monitor)
+{
+ /* TODO: update the mount with other details */
+
+ /* remove a mount if it goes into the shadows */
+ if (g_mount_is_shadowed (mount) && has_mount (monitor, mount)) {
+ remove_mount_link (monitor, mount);
+ }}
+
+static void
update_link_visibility (NautilusDesktopLinkMonitor *monitor,
NautilusDesktopLink **link_ref,
NautilusDesktopLinkType link_type,
Modified: trunk/libnautilus-private/nautilus-directory-async.c
==============================================================================
--- trunk/libnautilus-private/nautilus-directory-async.c (original)
+++ trunk/libnautilus-private/nautilus-directory-async.c Mon Feb 16 10:07:54 2009
@@ -4146,10 +4146,15 @@
found = NULL;
for (l = mounts; l != NULL; l = l->next) {
- root = g_mount_get_root (l->data);
+ GMount *mount = G_MOUNT (l->data);
+
+ if (g_mount_is_shadowed (mount))
+ continue;
+
+ root = g_mount_get_root (mount);
if (g_file_equal (target, root)) {
- found = g_object_ref (l->data);
+ found = g_object_ref (mount);
break;
}
Modified: trunk/src/file-manager/fm-tree-view.c
==============================================================================
--- trunk/src/file-manager/fm-tree-view.c (original)
+++ trunk/src/file-manager/fm-tree-view.c Mon Feb 16 10:07:54 2009
@@ -587,6 +587,9 @@
GFile *root;
GIcon *icon;
+ if (g_mount_is_shadowed (mount))
+ return;
+
icon = g_mount_get_icon (mount);
root = g_mount_get_root (mount);
mount_uri = g_file_get_uri (root);
Modified: trunk/src/nautilus-pathbar.c
==============================================================================
--- trunk/src/nautilus-pathbar.c (original)
+++ trunk/src/nautilus-pathbar.c Mon Feb 16 10:07:54 2009
@@ -1355,6 +1355,10 @@
mounts = g_volume_monitor_get_mounts (volume_monitor);
for (l = mounts; l != NULL; l = l->next) {
mount = l->data;
+ if (g_mount_is_shadowed (mount)) {
+ g_object_unref (mount);
+ continue;
+ }
if (result) {
g_object_unref (mount);
continue;
Modified: trunk/src/nautilus-places-sidebar.c
==============================================================================
--- trunk/src/nautilus-places-sidebar.c (original)
+++ trunk/src/nautilus-places-sidebar.c Mon Feb 16 10:07:54 2009
@@ -451,6 +451,10 @@
mounts = g_volume_monitor_get_mounts (volume_monitor);
for (l = mounts; l != NULL; l = l->next) {
mount = l->data;
+ if (g_mount_is_shadowed (mount)) {
+ g_object_unref (mount);
+ continue;
+ }
volume = g_mount_get_volume (mount);
if (volume != NULL) {
g_object_unref (volume);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]