GNOME Bugzilla – Bug 156366
Unmount should be possible from browser windows
Last modified: 2004-12-22 21:47:04 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.
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.
Bumping priority due to the patch's presence.
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).
Created attachment 33062 [details] [review] same patch as 33061 without the two forgotten printf()
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".
@@ -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.
Created attachment 33072 [details] [review] patch to apply with -p0 Fifth patch that takes your remarks into account. :)
In cvs. Thanks.