diff options
author | Gene Z. Ragan <gzr@eazel.com> | 2001-02-07 21:18:18 +0000 |
---|---|---|
committer | Gene Ragan <gzr@src.gnome.org> | 2001-02-07 21:18:18 +0000 |
commit | d5756f4cb95ed2e172afc3c26d6f91b7863deb91 (patch) | |
tree | 18b1f34156e8ddf80c35b4421a4f37e647716b3f | |
parent | e51f81d039813985af7130733fbe7428b538e5c1 (diff) | |
download | nautilus-d5756f4cb95ed2e172afc3c26d6f91b7863deb91.tar.gz |
reviewed by: Robin Slomkowski <robin@eazel.com>
2001-02-07 Gene Z. Ragan <gzr@eazel.com>
reviewed by: Robin Slomkowski <robin@eazel.com>
Fixed bug 6389, Extremely poor performance when
autodir automounter is present
Detect special NFS autofs directories and filter them out
of the mount list.
* libnautilus-extensions/nautilus-volume-monitor.c:
(get_removable_volumes), (mount_volume_activate_nfs),
(mount_volume_activate), (get_current_mount_list),
(mount_volume_nfs_add), (mount_volume_add_filesystem):
Worked on cleaning up placement of icons on the edges
of the desktop based on input from Arlo.
* libnautilus-extensions/nautilus-icon-container.c:
(icon_set_position):
-rw-r--r-- | ChangeLog | 21 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-icon-container.c | 11 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-volume-monitor.c | 45 | ||||
-rw-r--r-- | libnautilus-private/nautilus-icon-container.c | 11 | ||||
-rw-r--r-- | libnautilus-private/nautilus-volume-monitor.c | 45 |
5 files changed, 99 insertions, 34 deletions
@@ -1,5 +1,26 @@ 2001-02-07 Gene Z. Ragan <gzr@eazel.com> + reviewed by: Robin Slomkowski <robin@eazel.com> + + Fixed bug 6389, Extremely poor performance when + autodir automounter is present + + Detect special NFS autofs directories and filter them out + of the mount list. + + * libnautilus-extensions/nautilus-volume-monitor.c: + (get_removable_volumes), (mount_volume_activate_nfs), + (mount_volume_activate), (get_current_mount_list), + (mount_volume_nfs_add), (mount_volume_add_filesystem): + + Worked on cleaning up placement of icons on the edges + of the desktop based on input from Arlo. + + * libnautilus-extensions/nautilus-icon-container.c: + (icon_set_position): + +2001-02-07 Gene Z. Ragan <gzr@eazel.com> + Fixed bug 6363, "Set Cover Image" button assumes fixed font height. diff --git a/libnautilus-extensions/nautilus-icon-container.c b/libnautilus-extensions/nautilus-icon-container.c index c7f32cb87..99dd3c370 100644 --- a/libnautilus-extensions/nautilus-icon-container.c +++ b/libnautilus-extensions/nautilus-icon-container.c @@ -106,6 +106,9 @@ #define DESKTOP_PAD_VERTICAL 10 #define CELL_SIZE 20 +/* Value used to protect against icons being dragged outside of the desktop bounds */ +#define DESKTOP_ICON_SAFETY_PAD 10 + enum { NAUTILUS_TYPESELECT_FLUSH_DELAY = 1000000 /* After this time the current typeselect buffer will be @@ -228,15 +231,15 @@ icon_set_position (NautilusIcon *icon, icon_get_bounding_box (icon, &x1, &y1, &x2, &y2); width = x2 - x1; height = y2 - y1; - - if (x > right - width) { - x = right - width; + + if (x > right) { + x = right - DESKTOP_ICON_SAFETY_PAD; } if (x < left) { x = left; } if (y > bottom - height) { - y = bottom - height; + y = bottom - DESKTOP_ICON_SAFETY_PAD; } if (y < top) { y = top; diff --git a/libnautilus-extensions/nautilus-volume-monitor.c b/libnautilus-extensions/nautilus-volume-monitor.c index 2b82447e4..fae066d1f 100644 --- a/libnautilus-extensions/nautilus-volume-monitor.c +++ b/libnautilus-extensions/nautilus-volume-monitor.c @@ -287,8 +287,7 @@ get_removable_volumes (void) volume->device_path = g_strdup (ent->mnt_fsname); volume->mount_path = g_strdup (ent->mnt_dir); volume->filesystem = g_strdup (ent->mnt_type); - if (mount_volume_add_filesystem (volume)) { - mount_volume_get_name (volume); + if (mount_volume_add_filesystem (volume)) { volumes = g_list_append (volumes, volume); } else { nautilus_volume_monitor_free_volume (volume); @@ -557,6 +556,11 @@ mount_volume_activate_msdos (NautilusVolumeMonitor *view, NautilusVolume *volume } static void +mount_volume_activate_nfs (NautilusVolumeMonitor *view, NautilusVolume *volume) +{ +} + +static void mount_volume_activate_generic (NautilusVolumeMonitor *view, NautilusVolume *volume) { } @@ -638,11 +642,14 @@ mount_volume_activate (NautilusVolumeMonitor *monitor, NautilusVolume *volume) mount_volume_activate_msdos (monitor, volume); break; + case NAUTILUS_VOLUME_NFS: + mount_volume_activate_nfs (monitor, volume); + break; + case NAUTILUS_VOLUME_AFFS: case NAUTILUS_VOLUME_FAT: case NAUTILUS_VOLUME_HPFS: case NAUTILUS_VOLUME_MINIX: - case NAUTILUS_VOLUME_NFS: case NAUTILUS_VOLUME_SMB: case NAUTILUS_VOLUME_UDF: case NAUTILUS_VOLUME_UFS: @@ -780,7 +787,6 @@ get_current_mount_list (void) volume->filesystem = nautilus_string_list_nth (list, 2); if (mount_volume_add_filesystem (volume)) { - mount_volume_get_name (volume); current_mounts = g_list_append (current_mounts, volume); } else { nautilus_volume_monitor_free_volume (volume); @@ -798,9 +804,11 @@ get_current_mount_list (void) volume->device_path = g_strdup ("/dev/cdrom"); volume->mount_path = g_strdup ("/dev/cdrom"); volume->filesystem = g_strdup ("cdda"); - mount_volume_add_filesystem (volume); - mount_volume_get_name (volume); - current_mounts = g_list_append (current_mounts, volume); + if (mount_volume_get_name (volume)) { + current_mounts = g_list_append (current_mounts, volume); + } else { + nautilus_volume_monitor_free_volume (volume); + } } #endif @@ -1095,6 +1103,16 @@ mount_volume_minix_add (NautilusVolume *volume) static gboolean mount_volume_nfs_add (NautilusVolume *volume) { + /* We need to filter out autofs magic NFS directories. These entries will have the text + * "(pid" in the first element of its entry in /proc/mounts. An example would be eazel:(pid1234) + * or eazel(pid1234). If we signal that the volume monitor has added this type of file system + * the trash monitor will become confused and recurse indefinitely. + */ + + if (strstr (volume->device_path, "(pid") != NULL) { + return FALSE; + } + volume->type = NAUTILUS_VOLUME_NFS; return TRUE; } @@ -1575,9 +1593,7 @@ static gboolean mount_volume_add_filesystem (NautilusVolume *volume) { gboolean mounted = FALSE; - - - + if (nautilus_str_has_prefix (volume->device_path, FLOPPY_DEVICE_PATH_PREFIX)) { mounted = mount_volume_floppy_add (volume); } else if (strcmp (volume->filesystem, "affs") == 0) { @@ -1616,9 +1632,12 @@ mount_volume_add_filesystem (NautilusVolume *volume) mounted = mount_volume_xiafs_add (volume); } - volume->is_removable = volume_is_removable (volume); - volume->is_read_only = volume_is_read_only (volume);; - + if (mounted) { + volume->is_removable = volume_is_removable (volume); + volume->is_read_only = volume_is_read_only (volume); + mount_volume_get_name (volume); + } + return mounted; } diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c index c7f32cb87..99dd3c370 100644 --- a/libnautilus-private/nautilus-icon-container.c +++ b/libnautilus-private/nautilus-icon-container.c @@ -106,6 +106,9 @@ #define DESKTOP_PAD_VERTICAL 10 #define CELL_SIZE 20 +/* Value used to protect against icons being dragged outside of the desktop bounds */ +#define DESKTOP_ICON_SAFETY_PAD 10 + enum { NAUTILUS_TYPESELECT_FLUSH_DELAY = 1000000 /* After this time the current typeselect buffer will be @@ -228,15 +231,15 @@ icon_set_position (NautilusIcon *icon, icon_get_bounding_box (icon, &x1, &y1, &x2, &y2); width = x2 - x1; height = y2 - y1; - - if (x > right - width) { - x = right - width; + + if (x > right) { + x = right - DESKTOP_ICON_SAFETY_PAD; } if (x < left) { x = left; } if (y > bottom - height) { - y = bottom - height; + y = bottom - DESKTOP_ICON_SAFETY_PAD; } if (y < top) { y = top; diff --git a/libnautilus-private/nautilus-volume-monitor.c b/libnautilus-private/nautilus-volume-monitor.c index 2b82447e4..fae066d1f 100644 --- a/libnautilus-private/nautilus-volume-monitor.c +++ b/libnautilus-private/nautilus-volume-monitor.c @@ -287,8 +287,7 @@ get_removable_volumes (void) volume->device_path = g_strdup (ent->mnt_fsname); volume->mount_path = g_strdup (ent->mnt_dir); volume->filesystem = g_strdup (ent->mnt_type); - if (mount_volume_add_filesystem (volume)) { - mount_volume_get_name (volume); + if (mount_volume_add_filesystem (volume)) { volumes = g_list_append (volumes, volume); } else { nautilus_volume_monitor_free_volume (volume); @@ -557,6 +556,11 @@ mount_volume_activate_msdos (NautilusVolumeMonitor *view, NautilusVolume *volume } static void +mount_volume_activate_nfs (NautilusVolumeMonitor *view, NautilusVolume *volume) +{ +} + +static void mount_volume_activate_generic (NautilusVolumeMonitor *view, NautilusVolume *volume) { } @@ -638,11 +642,14 @@ mount_volume_activate (NautilusVolumeMonitor *monitor, NautilusVolume *volume) mount_volume_activate_msdos (monitor, volume); break; + case NAUTILUS_VOLUME_NFS: + mount_volume_activate_nfs (monitor, volume); + break; + case NAUTILUS_VOLUME_AFFS: case NAUTILUS_VOLUME_FAT: case NAUTILUS_VOLUME_HPFS: case NAUTILUS_VOLUME_MINIX: - case NAUTILUS_VOLUME_NFS: case NAUTILUS_VOLUME_SMB: case NAUTILUS_VOLUME_UDF: case NAUTILUS_VOLUME_UFS: @@ -780,7 +787,6 @@ get_current_mount_list (void) volume->filesystem = nautilus_string_list_nth (list, 2); if (mount_volume_add_filesystem (volume)) { - mount_volume_get_name (volume); current_mounts = g_list_append (current_mounts, volume); } else { nautilus_volume_monitor_free_volume (volume); @@ -798,9 +804,11 @@ get_current_mount_list (void) volume->device_path = g_strdup ("/dev/cdrom"); volume->mount_path = g_strdup ("/dev/cdrom"); volume->filesystem = g_strdup ("cdda"); - mount_volume_add_filesystem (volume); - mount_volume_get_name (volume); - current_mounts = g_list_append (current_mounts, volume); + if (mount_volume_get_name (volume)) { + current_mounts = g_list_append (current_mounts, volume); + } else { + nautilus_volume_monitor_free_volume (volume); + } } #endif @@ -1095,6 +1103,16 @@ mount_volume_minix_add (NautilusVolume *volume) static gboolean mount_volume_nfs_add (NautilusVolume *volume) { + /* We need to filter out autofs magic NFS directories. These entries will have the text + * "(pid" in the first element of its entry in /proc/mounts. An example would be eazel:(pid1234) + * or eazel(pid1234). If we signal that the volume monitor has added this type of file system + * the trash monitor will become confused and recurse indefinitely. + */ + + if (strstr (volume->device_path, "(pid") != NULL) { + return FALSE; + } + volume->type = NAUTILUS_VOLUME_NFS; return TRUE; } @@ -1575,9 +1593,7 @@ static gboolean mount_volume_add_filesystem (NautilusVolume *volume) { gboolean mounted = FALSE; - - - + if (nautilus_str_has_prefix (volume->device_path, FLOPPY_DEVICE_PATH_PREFIX)) { mounted = mount_volume_floppy_add (volume); } else if (strcmp (volume->filesystem, "affs") == 0) { @@ -1616,9 +1632,12 @@ mount_volume_add_filesystem (NautilusVolume *volume) mounted = mount_volume_xiafs_add (volume); } - volume->is_removable = volume_is_removable (volume); - volume->is_read_only = volume_is_read_only (volume);; - + if (mounted) { + volume->is_removable = volume_is_removable (volume); + volume->is_read_only = volume_is_read_only (volume); + mount_volume_get_name (volume); + } + return mounted; } |