summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-desktop-link.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2004-12-12 20:01:33 +0000
committerAlexander Larsson <alexl@src.gnome.org>2004-12-12 20:01:33 +0000
commit30a9cf39ed20d80c0e107e058a7d24cc2adf6bbf (patch)
treef43431443cb05629a2123e8f69f64b32dfe78c41 /libnautilus-private/nautilus-desktop-link.c
parenta5f7e776957062573ba7c2b2d784b9f2a6f84cf4 (diff)
downloadnautilus-30a9cf39ed20d80c0e107e058a7d24cc2adf6bbf.tar.gz
Make sure volume filenames are unique (#153888)
2004-12-12 Alexander Larsson <alexl@redhat.com> * libnautilus-private/nautilus-desktop-link-monitor.c: (destroy_desktop_link_monitor), (nautilus_desktop_link_monitor_get), (volume_file_name_used), (nautilus_desktop_link_monitor_make_filename_unique), (create_volume_link), (nautilus_desktop_link_monitor_init): * libnautilus-private/nautilus-desktop-link-monitor.h: * libnautilus-private/nautilus-desktop-link.c: (nautilus_desktop_link_new_from_volume): Make sure volume filenames are unique (#153888)
Diffstat (limited to 'libnautilus-private/nautilus-desktop-link.c')
-rw-r--r--libnautilus-private/nautilus-desktop-link.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/libnautilus-private/nautilus-desktop-link.c b/libnautilus-private/nautilus-desktop-link.c
index 2d88a5f2b..daf7ffd34 100644
--- a/libnautilus-private/nautilus-desktop-link.c
+++ b/libnautilus-private/nautilus-desktop-link.c
@@ -24,6 +24,7 @@
#include <config.h>
#include "nautilus-desktop-link.h"
+#include "nautilus-desktop-link-monitor.h"
#include "nautilus-desktop-icon-file.h"
#include "nautilus-directory-private.h"
#include "nautilus-desktop-directory.h"
@@ -188,7 +189,7 @@ nautilus_desktop_link_new_from_volume (GnomeVFSVolume *volume)
{
NautilusDesktopLink *link;
GnomeVFSDrive *drive;
- char *name;
+ char *name, *filename;
link = NAUTILUS_DESKTOP_LINK (g_object_new (NAUTILUS_TYPE_DESKTOP_LINK, NULL));
@@ -205,15 +206,19 @@ nautilus_desktop_link_new_from_volume (GnomeVFSVolume *volume)
name = gnome_vfs_volume_get_display_name (volume);
}
gnome_vfs_drive_unref (drive);
-
- link->details->filename = g_strconcat (name, ".volume", NULL);
+
+ filename = g_strconcat (name, ".volume", NULL);
+ link->details->filename =
+ nautilus_desktop_link_monitor_make_filename_unique (nautilus_desktop_link_monitor_get (),
+ filename);
+ g_free (filename);
g_free (name);
link->details->display_name = gnome_vfs_volume_get_display_name (volume);
link->details->activation_uri = gnome_vfs_volume_get_activation_uri (volume);
link->details->icon = gnome_vfs_volume_get_icon (volume);
-
+
create_icon_file (link);
return link;