summaryrefslogtreecommitdiff
path: root/src/eom-window.c
diff options
context:
space:
mode:
authorFelix Riemann <[email protected]>2011-12-15 19:36:06 +0100
committerraveit65 <[email protected]>2018-07-03 10:39:59 +0200
commitfb4446d3d00753a9918a4792e73a70b4a806ce09 (patch)
treefb4c8e3b7fe7886b94cce6fec5ce615330fad4b3 /src/eom-window.c
parent07de8758476b62430ca15f29d0d75b88afef1345 (diff)
downloadeom-fb4446d3d00753a9918a4792e73a70b4a806ce09.tar.bz2
eom-fb4446d3d00753a9918a4792e73a70b4a806ce09.tar.xz
Use new DBus API to show the current image in the file browser
This improves the functionality implemented with commit 9df5fd43. The new API that will be included in Nautilus 3.3.4 not only opens a view for the containing folder but also marks the image in the view. The old behaviour is still available as fallback if the new API is not offered on the system. https://bugzilla.gnome.org/show_bug.cgi?id=650402 origin commit: https://git.gnome.org/browse/eog/commit/?h=gnome-3-4&id=fa74473
Diffstat (limited to 'src/eom-window.c')
-rw-r--r--src/eom-window.c40
1 files changed, 6 insertions, 34 deletions
diff --git a/src/eom-window.c b/src/eom-window.c
index 4bff663..1fb2e60 100644
--- a/src/eom-window.c
+++ b/src/eom-window.c
@@ -2956,49 +2956,21 @@ eom_window_cmd_save_as (GtkAction *action, gpointer user_data)
static void
eom_window_cmd_open_containing_folder (GtkAction *action, gpointer user_data)
{
- EomWindow *window = EOM_WINDOW (user_data);
EomWindowPrivate *priv;
- GtkWidget *eom_window_widget;
-
GFile *file;
- GFile *parent = NULL;
-
- eom_window_widget = GTK_WIDGET (window);
- priv = window->priv;
+ g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+ priv = EOM_WINDOW (user_data)->priv;
g_return_if_fail (priv->image != NULL);
file = eom_image_get_file (priv->image);
- if (file) {
- parent = g_file_get_parent (file);
- g_object_unref(file);
- }
-
- if (parent) {
- char *parent_uri;
+ g_return_if_fail (file != NULL);
- parent_uri = g_file_get_uri (parent);
- if (parent_uri) {
- GdkScreen *screen;
- guint32 timestamp;
- GError *error;
-
- screen = gtk_widget_get_screen (eom_window_widget);
- timestamp = gtk_get_current_event_time ();
-
- error = NULL;
- if (!gtk_show_uri (screen, parent_uri, timestamp, &error)) {
- eom_debug_message (DEBUG_WINDOW, "Could not open the containing folder");
- g_error_free (error);
- }
-
- g_free (parent_uri);
- }
-
- g_object_unref(parent);
- }
+ eom_util_show_file_in_filemanager (file,
+ gtk_widget_get_screen (GTK_WIDGET (user_data)));
}
static void