Fixed bug 4700, ejecting an audio cd kills Nautilus

2000-11-13  Gene Z. Ragan  <gzr@eazel.com>

	Fixed bug 4700, ejecting an audio cd kills Nautilus

	* libnautilus-extensions/nautilus-volume-monitor.c:
	(nautilus_volume_monitor_get_volume_name):
	Check for NULL string before using it.

	* src/file-manager/fm-desktop-icon-view.c:
	(volume_unmounted_callback):
	Don't bother emiting signal if volume was never mounted
	in the first place.
This commit is contained in:
Gene Z. Ragan 2000-11-14 01:26:49 +00:00 committed by Gene Ragan
parent d9a52e0ceb
commit 5108ef7855
4 changed files with 32 additions and 0 deletions

View file

@ -1,3 +1,16 @@
2000-11-13 Gene Z. Ragan <gzr@eazel.com>
Fixed bug 4700, ejecting an audio cd kills Nautilus
* libnautilus-extensions/nautilus-volume-monitor.c:
(nautilus_volume_monitor_get_volume_name):
Check for NULL string before using it.
* src/file-manager/fm-desktop-icon-view.c:
(volume_unmounted_callback):
Don't bother emiting signal if volume was never mounted
in the first place.
2000-11-13 John Sullivan <sullivan@eazel.com>
reviewed by: Darin Adler <darin@eazel.com>

View file

@ -300,6 +300,10 @@ nautilus_volume_monitor_get_volume_name (const NautilusVolume *volume)
int index;
char *name;
if (volume->volume_name == NULL) {
return NULL;
}
name = g_strdup (volume->volume_name);
/* Strip whitespace from the end of the name. */

View file

@ -300,6 +300,10 @@ nautilus_volume_monitor_get_volume_name (const NautilusVolume *volume)
int index;
char *name;
if (volume->volume_name == NULL) {
return NULL;
}
name = g_strdup (volume->volume_name);
/* Strip whitespace from the end of the name. */

View file

@ -582,11 +582,22 @@ volume_unmounted_callback (NautilusVolumeMonitor *monitor,
GnomeVFSResult result;
char *link_path, *link_uri, *desktop_path, *volume_name;
GList dummy_list;
g_assert (volume);
desktop_path = nautilus_get_desktop_directory ();
volume_name = nautilus_volume_monitor_get_volume_name (volume);
if (volume_name == NULL) {
return;
}
link_path = nautilus_make_path (desktop_path, volume_name);
link_uri = gnome_vfs_get_uri_from_local_path (link_path);
if (link_uri == NULL) {
g_free (link_path);
g_free (volume_name);
return;
}
/* Remove mounted device icon from desktop */
dummy_list.data = link_uri;