From: Michael Orlitzky Date: Sat, 26 Oct 2019 15:18:05 +0000 (-0400) Subject: xfce4-hdaps-dialogs.c: remove redundant double-launch. X-Git-Tag: v1.0.0~6 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=e12029299b67c2f2391d12e0aa1b7ae2eb660b0f;p=xfce4-hdaps.git xfce4-hdaps-dialogs.c: remove redundant double-launch. There was a fallback condition in one of our URI handlers that fell back to the same thing that just failed. Instead of that genius idea, it now reports an error, which is what the other URI handler within the plugin does too. --- diff --git a/panel-plugin/xfce4-hdaps-dialogs.c b/panel-plugin/xfce4-hdaps-dialogs.c index 4a995df..5ac7860 100644 --- a/panel-plugin/xfce4-hdaps-dialogs.c +++ b/panel-plugin/xfce4-hdaps-dialogs.c @@ -203,15 +203,14 @@ void hdaps_configure(XfcePanelPlugin *plugin, static void hdaps_uri_handler(GtkAboutDialog *about, const gchar *uri, gpointer data) { - gchar *cmd; - cmd = g_strdup_printf("%s %s","xdg-open", uri); + gchar *cmd = g_strdup_printf("%s %s","xdg-open", uri); + gboolean spawn_result = g_spawn_command_line_async(cmd, NULL); - if (!g_spawn_command_line_async(cmd, NULL)) { - g_free(cmd); - cmd = g_strdup_printf("%s %s","xdg-open", uri); - g_spawn_command_line_async(cmd, NULL); + if (G_UNLIKELY(spawn_result == FALSE)) { + g_warning(_("Unable to open the following uri: %s"), uri); } + g_free(cmd); }