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);
}