[tasks] Use gtk_show_uri if it is available



commit 628e6fae78724e527f0258d45289341de6598b4c
Author: Ross Burton <ross linux intel com>
Date:   Fri Mar 27 17:04:38 2009 +0000

    Use gtk_show_uri if it is available
---
 src/gtk/main.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/gtk/main.c b/src/gtk/main.c
index e0fe85a..966c450 100644
--- a/src/gtk/main.c
+++ b/src/gtk/main.c
@@ -496,6 +496,15 @@ static const GtkToggleActionEntry task_toggle_actions[] =
 void
 koto_platform_open_url (const char *url)
 {
+#if HAVE_DECL_GTK_SHOW_URI
+  GError *error = NULL;
+
+  /* TODO: pass screen and timestamp */
+  if (!gtk_show_uri (NULL, url, GDK_CURRENT_TIME, &error)) {
+    g_warning ("Cannot open URL: %s", error->message);
+    g_error_free (error);
+  }
+#else
   char cmd[1024];
 
   g_snprintf (cmd, sizeof (cmd), "gnome-open \"%s\"", url);  
@@ -511,6 +520,7 @@ koto_platform_open_url (const char *url)
     return;
 
   g_warning ("Cannot start gnome-open, xdg-open, or firefox");
+#endif
 }
 
 void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]