OBS User unknown 2007-08-17 16:58:01 +00:00 committed by Git OBS Bridge
parent 83c7901dd4
commit d4cb8e5e7f
3 changed files with 145 additions and 53 deletions

View File

@ -1,3 +1,22 @@
2007-05-24 Hans Petter Jansson <hpj@novell.com>
Fix https://bugzilla.novell.com/show_bug.cgi?id=276193, unable
to right-click after accessing files on CD via GUI. The problem
was that Nautilus was crashing under some circumstances when
unmounting/ejecting a CD. It was caused by some of the code
previously introduced by this patch.
The fix consists of ignoring the desktop link we are currently
repopulating when scanning the list of desktop links to uniquefy
the new filename for this link.
* libnautilus-private/nautilus-desktop-link-monitor.[ch]
(nautilus_desktop_link_monitor_make_filename_unique): Add a
"skip_link" argument that will make the algorithm skip the
provided desktop link when considering non-unique filenames.
(volume_file_name_used): Skip the link passed from caller,
if any.
2006-11-08 Federico Mena Quintero <federico@novell.com>
Fix https://bugzilla.novell.com/show_bug.cgi?id=215351, the icon
@ -162,9 +181,11 @@
transformation of a link from a drive to volume when an unmounted
drive gets first mounted, and vice-versa.
--- nautilus/libnautilus-private/nautilus-desktop-icon-file.c 2006-03-20 07:35:57.000000000 -0600
+++ nautilus/libnautilus-private/nautilus-desktop-icon-file.c 2006-11-08 13:17:55.000000000 -0600
@@ -179,7 +179,7 @@ update_info_from_link (NautilusDesktopIc
diff --git a/libnautilus-private/nautilus-desktop-icon-file.c b/libnautilus-private/nautilus-desktop-icon-file.c
index 733be41..9e00f5a 100644
--- a/libnautilus-private/nautilus-desktop-icon-file.c
+++ b/libnautilus-private/nautilus-desktop-icon-file.c
@@ -179,7 +179,7 @@ update_info_from_link (NautilusDesktopIconFile *icon_file)
NautilusFile *file;
GnomeVFSFileInfo *file_info;
NautilusDesktopLink *link;
@ -173,7 +194,7 @@
file = NAUTILUS_FILE (icon_file);
@@ -216,9 +216,25 @@ update_info_from_link (NautilusDesktopIc
@@ -216,9 +216,25 @@ update_info_from_link (NautilusDesktopIconFile *icon_file)
GNOME_VFS_FILE_INFO_FIELDS_ACCESS |
GNOME_VFS_FILE_INFO_FIELDS_LINK_COUNT;
@ -202,9 +223,11 @@
file->details->file_info_is_up_to_date = TRUE;
--- nautilus/libnautilus-private/nautilus-desktop-link-monitor.c 2006-03-20 07:35:57.000000000 -0600
+++ nautilus/libnautilus-private/nautilus-desktop-link-monitor.c 2006-11-08 11:40:09.000000000 -0600
@@ -52,13 +52,14 @@ struct NautilusDesktopLinkMonitorDetails
diff --git a/libnautilus-private/nautilus-desktop-link-monitor.c b/libnautilus-private/nautilus-desktop-link-monitor.c
index 6469c6a..c8e85d9 100644
--- a/libnautilus-private/nautilus-desktop-link-monitor.c
+++ b/libnautilus-private/nautilus-desktop-link-monitor.c
@@ -52,13 +52,14 @@ struct NautilusDesktopLinkMonitorDetails {
NautilusDesktopLink *trash_link;
NautilusDesktopLink *network_link;
@ -220,7 +243,7 @@
static void nautilus_desktop_link_monitor_init (gpointer object,
gpointer klass);
static void nautilus_desktop_link_monitor_class_init (gpointer klass);
@@ -69,6 +70,8 @@ EEL_CLASS_BOILERPLATE (NautilusDesktopLi
@@ -69,6 +70,8 @@ EEL_CLASS_BOILERPLATE (NautilusDesktopLinkMonitor,
static NautilusDesktopLinkMonitor *the_link_monitor = NULL;
@ -252,7 +275,7 @@
dialog_str = g_strdup_printf (_("You cannot move the volume \"%s\" to the trash."),
display_name);
- g_free (display_name);
-
- if (eject_for_type (gnome_vfs_volume_get_device_type (volume))) {
- eel_run_simple_dialog
- (parent_view,
@ -262,6 +285,7 @@
- _("If you want to eject the volume, please use \"Eject\" in the "
- "popup menu of the volume."),
- GTK_STOCK_OK, NULL);
+
+ if (eject_for_type (gnome_vfs_volume_get_device_type (GNOME_VFS_VOLUME (drive_or_volume)))) {
+ detail_str = _("If you want to eject the volume, please use \"Eject\" in the "
+ "popup menu of the volume.");
@ -302,7 +326,41 @@
}
void
@@ -196,6 +206,67 @@ nautilus_desktop_link_monitor_make_filen
@@ -161,6 +171,7 @@ nautilus_desktop_link_monitor_delete_link (NautilusDesktopLinkMonitor *monitor,
static gboolean
volume_file_name_used (NautilusDesktopLinkMonitor *monitor,
+ NautilusDesktopLink *skip_link,
const char *name)
{
GList *l;
@@ -168,6 +179,9 @@ volume_file_name_used (NautilusDesktopLinkMonitor *monitor,
gboolean same;
for (l = monitor->details->volume_links; l != NULL; l = l->next) {
+ if (l->data == skip_link)
+ continue;
+
other_name = nautilus_desktop_link_get_file_name (l->data);
same = strcmp (name, other_name) == 0;
g_free (other_name);
@@ -182,6 +196,7 @@ volume_file_name_used (NautilusDesktopLinkMonitor *monitor,
char *
nautilus_desktop_link_monitor_make_filename_unique (NautilusDesktopLinkMonitor *monitor,
+ NautilusDesktopLink *skip_link,
const char *filename)
{
char *unique_name;
@@ -189,13 +204,74 @@ nautilus_desktop_link_monitor_make_filename_unique (NautilusDesktopLinkMonitor *
i = 2;
unique_name = g_strdup (filename);
- while (volume_file_name_used (monitor, unique_name)) {
+ while (volume_file_name_used (monitor, skip_link, unique_name)) {
g_free (unique_name);
unique_name = g_strdup_printf ("%s.%d", filename, i++);
}
return unique_name;
}
@ -370,7 +428,7 @@
static void
create_volume_link (NautilusDesktopLinkMonitor *monitor,
GnomeVFSVolume *volume)
@@ -204,24 +275,198 @@ create_volume_link (NautilusDesktopLinkM
@@ -204,24 +280,198 @@ create_volume_link (NautilusDesktopLinkMonitor *monitor,
link = NULL;
@ -422,11 +480,11 @@
+ }
+
+ gnome_vfs_volume_unref (link_volume);
+ }
}
+
+ return same;
+}
+
}
+static NautilusDesktopLink *
+find_unique_link_for_drive (NautilusDesktopLinkMonitor *monitor,
+ GnomeVFSDrive *drive)
@ -435,7 +493,7 @@
+ NautilusDesktopLink *first_volume_link_for_drive;
+
+ first_volume_link_for_drive = NULL;
+
+ for (l = monitor->details->volume_links; l; l = l->next) {
+ NautilusDesktopLink *link;
+
@ -452,7 +510,7 @@
+ */
+ }
+ }
}
+ }
+
+ return first_volume_link_for_drive;
+}
@ -472,8 +530,8 @@
+ return; /* huh, we already have a link for that drive... */
+
+ create_drive_link (monitor, drive);
}
+}
+
+static void
+drive_disconnected_callback (GnomeVFSVolumeMonitor *volume_monitor,
+ GnomeVFSDrive *drive,
@ -492,7 +550,7 @@
+ while (l) {
+ GList *next;
+ NautilusDesktopLink *link;
+
+ next = l->next;
+ link = NAUTILUS_DESKTOP_LINK (l->data);
+
@ -574,7 +632,7 @@
}
@@ -230,22 +475,31 @@ volume_unmounted_callback (GnomeVFSVolum
@@ -230,22 +480,31 @@ volume_unmounted_callback (GnomeVFSVolumeMonitor *volume_monitor,
GnomeVFSVolume *volume,
NautilusDesktopLinkMonitor *monitor)
{
@ -617,7 +675,7 @@
monitor->details->volume_links = g_list_remove (monitor->details->volume_links, link);
g_object_unref (link);
}
@@ -322,32 +576,60 @@ desktop_network_visible_changed (gpointe
@@ -322,32 +581,60 @@ desktop_network_visible_changed (gpointer callback_data)
}
static void
@ -693,7 +751,7 @@
create_link_and_add_preference (NautilusDesktopLink **link_ref,
NautilusDesktopLinkType link_type,
const char *preference_key,
@@ -365,8 +647,6 @@ static void
@@ -365,8 +652,6 @@ static void
nautilus_desktop_link_monitor_init (gpointer object, gpointer klass)
{
NautilusDesktopLinkMonitor *monitor;
@ -702,7 +760,7 @@
GnomeVFSVolumeMonitor *volume_monitor;
monitor = NAUTILUS_DESKTOP_LINK_MONITOR (object);
@@ -404,22 +684,22 @@ nautilus_desktop_link_monitor_init (gpoi
@@ -404,22 +689,22 @@ nautilus_desktop_link_monitor_init (gpointer object, gpointer klass)
desktop_network_visible_changed,
monitor);
@ -735,9 +793,23 @@
monitor->details->mount_id = g_signal_connect_object (volume_monitor, "volume_mounted",
G_CALLBACK (volume_mounted_callback), monitor, 0);
monitor->details->unmount_id = g_signal_connect_object (volume_monitor, "volume_unmounted",
--- nautilus/libnautilus-private/nautilus-desktop-link.c 2006-03-20 07:35:57.000000000 -0600
+++ nautilus/libnautilus-private/nautilus-desktop-link.c 2006-11-08 13:15:10.000000000 -0600
@@ -53,8 +53,8 @@ struct NautilusDesktopLinkDetails {
diff --git a/libnautilus-private/nautilus-desktop-link-monitor.h b/libnautilus-private/nautilus-desktop-link-monitor.h
index 2c3c23d..1622ced 100644
--- a/libnautilus-private/nautilus-desktop-link-monitor.h
+++ b/libnautilus-private/nautilus-desktop-link-monitor.h
@@ -59,6 +59,7 @@ void nautilus_desktop_link_monitor_delete_link (NautilusDesktopLinkMonitor *moni
/* Used by nautilus-desktop-link.c */
char * nautilus_desktop_link_monitor_make_filename_unique (NautilusDesktopLinkMonitor *monitor,
+ NautilusDesktopLink *skip_link,
const char *filename);
#endif /* NAUTILUS_DESKTOP_LINK_MONITOR_H */
diff --git a/libnautilus-private/nautilus-desktop-link.c b/libnautilus-private/nautilus-desktop-link.c
index e27bac4..621245a 100644
--- a/libnautilus-private/nautilus-desktop-link.c
+++ b/libnautilus-private/nautilus-desktop-link.c
@@ -54,8 +54,8 @@ struct NautilusDesktopLinkDetails {
/* Just for trash icons: */
gulong trash_state_handler;
@ -748,7 +820,7 @@
};
static void nautilus_desktop_link_init (gpointer object,
@@ -192,28 +192,52 @@ nautilus_desktop_link_new (NautilusDeskt
@@ -208,50 +208,105 @@ nautilus_desktop_link_new (NautilusDesktopLinkType type)
return link;
}
@ -777,7 +849,12 @@
+ if (GNOME_IS_VFS_VOLUME (link->details->drive_or_volume)) {
+ GnomeVFSVolume *volume;
+ GnomeVFSDrive *drive;
+
- /* We try to use the drive name to get somewhat stable filenames
- for metadata */
- drive = gnome_vfs_volume_get_drive (volume);
- if (drive != NULL) {
- name = gnome_vfs_drive_get_display_name (drive);
+ volume = GNOME_VFS_VOLUME (link->details->drive_or_volume);
+
+ /* We try to use the drive name to get somewhat stable filenames
@ -789,12 +866,7 @@
+ name = gnome_vfs_volume_get_display_name (volume);
+ }
+ gnome_vfs_drive_unref (drive);
- /* We try to use the drive name to get somewhat stable filenames
- for metadata */
- drive = gnome_vfs_volume_get_drive (volume);
- if (drive != NULL) {
- name = gnome_vfs_drive_get_display_name (drive);
+
+ display_name = gnome_vfs_volume_get_display_name (volume);
+ activation_uri = gnome_vfs_volume_get_activation_uri (volume);
+ icon = gnome_vfs_volume_get_icon (volume);
@ -816,7 +888,8 @@
filename = g_strconcat (name, ".volume", NULL);
link->details->filename =
@@ -221,21 +245,51 @@ nautilus_desktop_link_new_from_volume (G
nautilus_desktop_link_monitor_make_filename_unique (nautilus_desktop_link_monitor_get (),
+ link,
filename);
g_free (filename);
g_free (name);
@ -843,7 +916,7 @@
- link->details->activation_uri = gnome_vfs_volume_get_activation_uri (volume);
- link->details->icon = gnome_vfs_volume_get_icon (volume);
+ link->details->type = NAUTILUS_DESKTOP_LINK_VOLUME;
+
+ if (is_volume) {
+ GnomeVFSVolume *volume;
+
@ -851,7 +924,7 @@
+ link->details->drive_or_volume = G_OBJECT (volume);
+ } else {
+ GnomeVFSDrive *drive;
+
+ drive = gnome_vfs_drive_ref (GNOME_VFS_DRIVE (object));
+ link->details->drive_or_volume = G_OBJECT (drive);
+ }
@ -875,7 +948,7 @@
}
@@ -389,7 +443,11 @@ desktop_link_finalize (GObject *object)
@@ -416,7 +471,11 @@ desktop_link_finalize (GObject *object)
}
if (link->details->type == NAUTILUS_DESKTOP_LINK_VOLUME) {
@ -888,7 +961,7 @@
}
g_free (link->details->filename);
@@ -411,3 +469,61 @@ nautilus_desktop_link_class_init (gpoint
@@ -438,3 +497,61 @@ nautilus_desktop_link_class_init (gpointer klass)
object_class->finalize = desktop_link_finalize;
}
@ -950,8 +1023,10 @@
+ reread_drive_or_volume (link);
+ nautilus_desktop_link_changed (link);
+}
--- nautilus/libnautilus-private/nautilus-desktop-link.h 10 Dec 2005 02:40:35 -0000 1.4
+++ nautilus/libnautilus-private/nautilus-desktop-link.h 6 Oct 2006 00:32:43 -0000
diff --git a/libnautilus-private/nautilus-desktop-link.h b/libnautilus-private/nautilus-desktop-link.h
index 578e592..e127500 100644
--- a/libnautilus-private/nautilus-desktop-link.h
+++ b/libnautilus-private/nautilus-desktop-link.h
@@ -26,6 +26,7 @@
#define NAUTILUS_DESKTOP_LINK_H
@ -969,7 +1044,7 @@
NautilusDesktopLinkType nautilus_desktop_link_get_link_type (NautilusDesktopLink *link);
char * nautilus_desktop_link_get_file_name (NautilusDesktopLink *link);
char * nautilus_desktop_link_get_display_name (NautilusDesktopLink *link);
@@ -70,10 +71,12 @@ char * nautilus_desktop
@@ -70,10 +71,12 @@ char * nautilus_desktop_link_get_activation_uri (NautilusDeskto
gboolean nautilus_desktop_link_get_date (NautilusDesktopLink *link,
NautilusDateType date_type,
time_t *date);
@ -983,9 +1058,11 @@
+ GnomeVFSVolume *volume);
#endif /* NAUTILUS_DESKTOP_LINK_H */
--- nautilus/src/file-manager/fm-directory-view.c 2006-11-07 19:43:42.000000000 -0600
+++ nautilus/src/file-manager/fm-directory-view.c 2006-11-07 19:44:17.000000000 -0600
@@ -303,11 +303,19 @@ typedef struct {
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index aa3b266..0a31995 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -301,11 +301,19 @@ typedef struct {
NautilusWindowOpenMode mode;
NautilusWindowOpenFlags flags;
gboolean mount_success;
@ -1006,7 +1083,7 @@
NautilusFile *file;
NautilusDirectory *directory;
} FileAndDirectory;
@@ -8184,7 +8192,7 @@ cancel_activate (gpointer callback_data)
@@ -8272,7 +8280,7 @@ cancel_activate (gpointer callback_data)
parameters->cancelled = TRUE;
@ -1015,7 +1092,7 @@
nautilus_file_list_cancel_call_when_ready (parameters->files_handle);
nautilus_file_list_free (parameters->files);
g_free (parameters);
@@ -8556,16 +8564,81 @@ activate_callback (GList *files, gpointe
@@ -8644,16 +8652,81 @@ activate_callback (GList *files, gpointer callback_data)
}
static void
@ -1099,7 +1176,7 @@
if (!succeeded && !parameters->cancelled) {
if (*error == 0 &&
@@ -8578,29 +8651,25 @@ activation_drive_mounted_callback (gbool
@@ -8666,29 +8739,25 @@ activation_drive_mounted_callback (gboolean succeeded,
}
}
@ -1145,7 +1222,7 @@
}
static void
@@ -8608,7 +8677,6 @@ activate_activation_uris_ready_callback
@@ -8696,7 +8765,6 @@ activate_activation_uris_ready_callback (GList *files_ignore,
gpointer callback_data)
{
ActivateParameters *parameters;
@ -1153,7 +1230,7 @@
GList *l, *next;
NautilusFile *file;
NautilusFile *actual_file;
@@ -8617,7 +8685,6 @@ activate_activation_uris_ready_callback
@@ -8705,7 +8773,6 @@ activate_activation_uris_ready_callback (GList *files_ignore,
char *uri;
parameters = callback_data;
@ -1161,7 +1238,7 @@
for (l = parameters->files; l != NULL; l = next) {
file = NAUTILUS_FILE (l->data);
@@ -8640,24 +8707,46 @@ activate_activation_uris_ready_callback
@@ -8728,24 +8795,46 @@ activate_activation_uris_ready_callback (GList *files_ignore,
drive = nautilus_file_get_drive (file);
if (drive != NULL &&
!gnome_vfs_drive_is_mounted (drive)) {
@ -1215,7 +1292,7 @@
/* activation_drive_mounted_callback will reveal whether all mounts were successful */
parameters->mount_success = TRUE;
@@ -8781,7 +8870,7 @@ fm_directory_view_activate_files (FMDire
@@ -8869,7 +8958,7 @@ fm_directory_view_activate_files (FMDirectoryView *view,
parameters->mode = mode;
parameters->flags = flags;
parameters->mount_success = FALSE;

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Thu Aug 16 19:51:38 CEST 2007 - federico@novell.com
- Updated nautilus-drives-and-volumes-on-desktop.diff to fix
https://bugzilla.novell.com/show_bug.cgi?id=298802 - after burning a
CD and re-mounting the CD, Nautilus uses 100% CPU. This simply
includes the last patch from
https://bugzilla.novell.com/show_bug.cgi?id=276193#c42
-------------------------------------------------------------------
Fri Aug 10 23:42:02 CEST 2007 - federico@novell.com

View File

@ -15,7 +15,7 @@ BuildRequires: cdparanoia eel-devel fdupes gnome-common gnome-icon-theme gnome-
License: GPL v2 or later
Group: Productivity/File utilities
Version: 2.19.6
Release: 6
Release: 10
Summary: The GNOME 2.x Desktop File Manager
Source: ftp://ftp.gnome.org/pub/gnome/sources/nautilus/2.16/%{name}-%{version}.tar.bz2
URL: http://www.gnome.org
@ -167,6 +167,12 @@ fi
%{_libdir}/pkgconfig/*.pc
%changelog
* Thu Aug 16 2007 - federico@novell.com
- Updated nautilus-drives-and-volumes-on-desktop.diff to fix
https://bugzilla.novell.com/show_bug.cgi?id=298802 - after burning a
CD and re-mounting the CD, Nautilus uses 100%% CPU. This simply
includes the last patch from
https://bugzilla.novell.com/show_bug.cgi?id=276193#c42
* Fri Aug 10 2007 - federico@novell.com
- Added nautilus-330298-297983-fix-overlapping-desktop-icons.diff to
fix https://bugzilla.novell.com/show_bug.cgi?id=297983 - desktop