diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2022-07-23 17:28:55 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2022-07-23 17:29:18 +0200 |
commit | 4e84d6a802f663153aca673f9bccbc45de8e5616 (patch) | |
tree | a03a25a6d77ed2a286b85465fa9d0856a3dd2806 | |
parent | f94171fcf2875c1e475a822b09be6d27a7a7bb18 (diff) | |
download | fiv-4e84d6a802f663153aca673f9bccbc45de8e5616.tar.gz fiv-4e84d6a802f663153aca673f9bccbc45de8e5616.tar.xz fiv-4e84d6a802f663153aca673f9bccbc45de8e5616.zip |
Don't eat application launch errors
-rw-r--r-- | fiv-context-menu.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fiv-context-menu.c b/fiv-context-menu.c index 387969b..1a4b022 100644 --- a/fiv-context-menu.c +++ b/fiv-context-menu.c @@ -45,12 +45,15 @@ open_context_launch(GtkWidget *widget, OpenContext *self) gdk_app_launch_context_set_screen(context, gtk_widget_get_screen(widget)); gdk_app_launch_context_set_timestamp(context, gtk_get_current_event_time()); - // TODO(p): Display errors. GList *files = g_list_append(NULL, self->file); + GError *error = NULL; if (g_app_info_launch( - self->app_info, files, G_APP_LAUNCH_CONTEXT(context), NULL)) { - g_app_info_set_as_last_used_for_type( + self->app_info, files, G_APP_LAUNCH_CONTEXT(context), &error)) { + (void) g_app_info_set_as_last_used_for_type( self->app_info, self->content_type, NULL); + } else { + g_warning("%s", error->message); + g_error_free(error); } g_list_free(files); g_object_unref(context); |