After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 156366 - Unmount should be possible from browser windows
Unmount should be possible from browser windows
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: [obsolete] Sidebar Panel: Tree
unspecified
Other Linux
: High normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-10-25 07:44 UTC by Colin Leroy
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch, apply with -p1 (4.80 KB, patch)
2004-10-25 11:55 UTC, Colin Leroy
none Details | Review
second patch (apply with -p0) (7.55 KB, patch)
2004-10-26 07:29 UTC, Colin Leroy
none Details | Review
same patch as 33061 without the two forgotten printf() (7.21 KB, patch)
2004-10-26 09:28 UTC, Colin Leroy
none Details | Review
patch to apply with -p0 (7.77 KB, patch)
2004-10-26 11:53 UTC, Colin Leroy
none Details | Review
patch to apply with -p0 (8.36 KB, patch)
2004-10-26 12:50 UTC, Colin Leroy
none Details | Review

Description Colin Leroy 2004-10-25 07:44:18 UTC
Nautilus allows one to unmount media from the desktop icons. It should let us
unmount from the left part of browser windows (directory view) too.
Comment 1 Colin Leroy 2004-10-25 11:55:42 UTC
Created attachment 33020 [details] [review]
patch, apply with -p1

This patch adds the described functionality. It may need a bit of cleanup to
avoid duplicating functions with fm-directory-view.c, but works as is.
Comment 2 Colin Leroy 2004-10-25 11:56:28 UTC
Bumping priority due to the patch's presence.
Comment 3 Colin Leroy 2004-10-26 07:29:16 UTC
Created attachment 33061 [details] [review]
second patch (apply with -p0)

This patch is a cleanup of the first one, which was more of a hack due to
nuatilus_file_get_volume() for some reason. I added the way to set the file's
volume in the tree model, then traced why file->details->volume got always
reset to NULL - this was due to some bug in nautilus-directory-async, where the
file's volume and drive are lost (my patch contains a workaround that is
probably not perfect, but which fixes the bug).
Comment 4 Colin Leroy 2004-10-26 09:28:21 UTC
Created attachment 33062 [details] [review]
same patch as 33061 without the two forgotten printf()
Comment 5 Colin Leroy 2004-10-26 11:53:52 UTC
Created attachment 33070 [details] [review]
patch to apply with -p0

Fourth patch. This one removes the hunk in nautilus-directory-async.c which was
wrong (fixing symptoms in the wrong place), and uses the TreeNode to store the
GnomeVFSVolume instead of forcing it in the NautilusFile. Also fixes the
strings by using "E_ject" and "_Unmount Volume".
Comment 6 Alexander Larsson 2004-10-26 12:26:47 UTC
@@ -86,6 +86,8 @@
 	guint done_loading : 1;
 	guint inserting_first_child : 1;
 	guint inserted : 1;
+
+	GnomeVFSVolume *volume;
 };
 

Put after icon_name instead



+	if (volume) {
+		gnome_vfs_volume_ref(volume);
+		node->volume = volume;


Missing space before parenthesis. 

+GnomeVFSVolume *
+fm_tree_model_get_volume_for_uri(FMTreeModel *model, const char *uri)

Missing space.
Make this take a NautilusFile * instead. That avoids roundtripping to
a uri. Also call it something like
fm_tree_model_get_volume_for_root_node_file()


+void
+fm_tree_model_add_root_uri_with_volume (FMTreeModel *model, const char
*root_uri, const char *display_name, const char *icon_name, GnomeVFSVolume *volume)

No need for an extra function for this. Just add a volume arg and
change the other places to pass NULL.

Also, you seem to be leaking the volume.

+	g_free(uri);

Missing space

+	menu_item = gtk_image_menu_item_new_with_label (_("_Unmount Volume Conditional"));

Don't translate this. Its later replaced by the right translated
string. Also, just call it "eject label" or something.

@@ -1095,6 +1197,7 @@
 	for (l = volumes; l != NULL; l = l->next) {
 		add_root_for_volume (view, l->data);
 		gnome_vfs_volume_unref (l->data);
+
 	}
 	g_list_free (volumes);
 	
Unnecessary whitespace changes.
Comment 7 Colin Leroy 2004-10-26 12:50:07 UTC
Created attachment 33072 [details] [review]
patch to apply with -p0

Fifth patch that takes your remarks into account. :)
Comment 8 Alexander Larsson 2004-10-26 13:28:22 UTC
In cvs. Thanks.