summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorRazvan Chitu <razvan.ch95@gmail.com>2016-07-12 12:08:23 +0300
committerRazvan Chitu <razvan.ch95@gmail.com>2016-07-12 12:56:04 +0300
commit9747312e6c2d5b4c37a52b4270108ef652603784 (patch)
tree1b12910ff2c639e6eea766839d62eb628a28563b /gtk
parentb5a2bba84071265ffd2c2327e710b8bee3318ea4 (diff)
downloadgtk+-9747312e6c2d5b4c37a52b4270108ef652603784.tar.gz
placesview: fix open action for locations without a mount or volume
In the "Other Locations" view, locations can be opened from the context menu based on their mount or volume. However, some locations, like "Computer", do not have either of those so they cannot be opened from the context menu. In order to fix this, the file associated with the location can be used as well. https://bugzilla.gnome.org/show_bug.cgi?id=768657
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkplacesview.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gtk/gtkplacesview.c b/gtk/gtkplacesview.c
index de13d24488..14e44cb31a 100644
--- a/gtk/gtkplacesview.c
+++ b/gtk/gtkplacesview.c
@@ -1469,11 +1469,20 @@ get_view_and_file (GtkPlacesViewRow *row,
mount = gtk_places_view_row_get_mount (row);
if (mount)
- *file = g_mount_get_default_location (mount);
+ {
+ *file = g_mount_get_default_location (mount);
+ }
else if (volume)
- *file = g_volume_get_activation_root (volume);
+ {
+ *file = g_volume_get_activation_root (volume);
+ }
else
- *file = NULL;
+ {
+ *file = gtk_places_view_row_get_file (row);
+ if (*file) {
+ g_object_ref (*file);
+ }
+ }
}
}