[gtk+/gtk-3-20] placesview: fix open action for locations without a mount or volume
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-20] placesview: fix open action for locations without a mount or volume
- Date: Thu, 4 Aug 2016 15:40:28 +0000 (UTC)
commit 1957e7137483ff4aaaa30ce4e1b1e7882a9c8da3
Author: Razvan Chitu <razvan ch95 gmail com>
Date: Tue Jul 12 12:08:23 2016 +0300
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
gtk/gtkplacesview.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkplacesview.c b/gtk/gtkplacesview.c
index 5388a1a..809688c 100644
--- a/gtk/gtkplacesview.c
+++ b/gtk/gtkplacesview.c
@@ -1468,11 +1468,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);
+ }
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]