From 1ffb12a82a5d808e4467fe18d9436c1088530f82 Mon Sep 17 00:00:00 2001 From: Denis Gorodnichev Date: Tue, 4 Mar 2014 00:55:57 +0400 Subject: gtk3: use preferred app --- drivemount/drive-button.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivemount/drive-button.c b/drivemount/drive-button.c index 1ff9c7cb..be8b4fa5 100644 --- a/drivemount/drive-button.c +++ b/drivemount/drive-button.c @@ -545,7 +545,7 @@ open_drive (DriveButton *self, GtkWidget *item) GFile *file = NULL; GList *files = NULL; GdkAppLaunchContext *launch_context; - GDesktopAppInfo *app_info; + GAppInfo *app_info; #else char *argv[3] = { "caja", NULL, NULL }; @@ -584,14 +584,16 @@ open_drive (DriveButton *self, GtkWidget *item) g_return_if_reached(); #if GTK_CHECK_VERSION (3, 0, 0) - app_info = g_desktop_app_info_new ("caja.desktop"); + app_info = g_app_info_get_default_for_type("inode/directory", FALSE); + if (!app_info) + app_info = G_APP_INFO (g_desktop_app_info_new ("caja.desktop")); if (app_info) { launch_context = gdk_app_launch_context_new (); screen = gtk_widget_get_screen (GTK_WIDGET (self)); gdk_app_launch_context_set_screen (launch_context, screen); files = g_list_prepend (files, file); - g_app_info_launch (G_APP_INFO (app_info), + g_app_info_launch (app_info, files, G_APP_LAUNCH_CONTEXT (launch_context), &error); -- cgit v1.2.1