ekiga r6696 - trunk/lib/toolbox



Author: jpuydt
Date: Sun Aug 24 23:17:08 2008
New Revision: 6696
URL: http://svn.gnome.org/viewvc/ekiga?rev=6696&view=rev

Log:
Fixed bug #538307 (bad gnome gm_open_uri implementation)

Added:
   trunk/lib/toolbox/toolbox-internal.c
      - copied, changed from r6695, /trunk/lib/toolbox/toolbox-gtk.c
   trunk/lib/toolbox/toolbox-internal.h
      - copied, changed from r6695, /trunk/lib/toolbox/toolbox-gnome.c
Modified:
   trunk/lib/toolbox/Makefile.am
   trunk/lib/toolbox/toolbox-gnome.c
   trunk/lib/toolbox/toolbox-gtk.c

Modified: trunk/lib/toolbox/Makefile.am
==============================================================================
--- trunk/lib/toolbox/Makefile.am	(original)
+++ trunk/lib/toolbox/Makefile.am	Sun Aug 24 23:17:08 2008
@@ -1,6 +1,10 @@
 noinst_LTLIBRARIES = libtoolbox.la
 
-libtoolbox_la_SOURCES = toolbox.h toolbox-common.c
+libtoolbox_la_SOURCES = \
+	toolbox.h		\
+	toolbox-common.c	\
+	toolbox-internal.h	\
+	toolbox-internal.c
 
 if WIN32
 libtoolbox_la_SOURCES += toolbox-win32.c

Modified: trunk/lib/toolbox/toolbox-gnome.c
==============================================================================
--- trunk/lib/toolbox/toolbox-gnome.c	(original)
+++ trunk/lib/toolbox/toolbox-gnome.c	Sun Aug 24 23:17:08 2008
@@ -35,6 +35,7 @@
  */
 
 #include "toolbox.h"
+#include "toolbox-internal.h"
 
 #include <gnome.h>
 
@@ -43,5 +44,6 @@
 {
   g_return_if_fail (uri != NULL);
 
-  gnome_url_show (uri, NULL);
+  if ( !gnome_url_show (uri, NULL))
+    gm_open_uri_fallback (uri);
 }

Modified: trunk/lib/toolbox/toolbox-gtk.c
==============================================================================
--- trunk/lib/toolbox/toolbox-gtk.c	(original)
+++ trunk/lib/toolbox/toolbox-gtk.c	Sun Aug 24 23:17:08 2008
@@ -35,40 +35,12 @@
  */
 
 #include "toolbox.h"
+#include "toolbox-internal.h"
 
 void
 gm_open_uri (const gchar *uri)
 {
-  gchar *commandline = NULL;
-  gboolean success = FALSE;
-
   g_return_if_fail (uri != NULL);
 
-  if (!success && g_getenv("KDE_FULL_SESSION") != NULL) {
-
-    commandline = g_strdup_printf ("kfmclient exec %s", uri);
-    success = g_spawn_command_line_async (commandline, NULL);
-    g_free (commandline);
-  }
-
-  if (!success) {
-
-    commandline = g_strdup_printf ("sensible-browser %s", uri);
-    success = g_spawn_command_line_async (commandline, NULL);
-    g_free (commandline);
-  }
-
-  if (!success) {
-
-    commandline = g_strdup_printf ("firefox %s", uri);
-    success = g_spawn_command_line_async (commandline, NULL);
-    g_free (commandline);
-  }
-
-  if (!success) {
-
-    commandline = g_strdup_printf ("konqueror %s", uri);
-    success = g_spawn_command_line_async (commandline, NULL);
-    g_free (commandline);
-  }
+  gm_open_uri_fallback (uri);
 }

Copied: trunk/lib/toolbox/toolbox-internal.c (from r6695, /trunk/lib/toolbox/toolbox-gtk.c)
==============================================================================
--- /trunk/lib/toolbox/toolbox-gtk.c	(original)
+++ trunk/lib/toolbox/toolbox-internal.c	Sun Aug 24 23:17:08 2008
@@ -1,6 +1,6 @@
 
 /* Ekiga -- A VoIP and Video-Conferencing application
- * Copyright (C) 2000-2006 Damien Sandras
+ * Copyright (C) 2000-2008 Damien Sandras
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -27,23 +27,21 @@
 
 
 /*
- *                         toolbox-gtk.c  -  description
+ *                         toolbox-internal.h  -  description 
  *                         ------------------------------------------
- *   begin                : Dec 2005
- *   copyright            : (C) 2005 by Julien Puydt
- *   description          : Various helper functions -- gtk implementation
+ *   begin                : Aug 2008
+ *   copyright            : (C) 2008 by Julien Puydt
+ *   description          : Declaration of internal-use functions
  */
 
-#include "toolbox.h"
+#include "toolbox-internal.h"
 
 void
-gm_open_uri (const gchar *uri)
+gm_open_uri_fallback (const gchar *uri)
 {
   gchar *commandline = NULL;
   gboolean success = FALSE;
 
-  g_return_if_fail (uri != NULL);
-
   if (!success && g_getenv("KDE_FULL_SESSION") != NULL) {
 
     commandline = g_strdup_printf ("kfmclient exec %s", uri);

Copied: trunk/lib/toolbox/toolbox-internal.h (from r6695, /trunk/lib/toolbox/toolbox-gnome.c)
==============================================================================
--- /trunk/lib/toolbox/toolbox-gnome.c	(original)
+++ trunk/lib/toolbox/toolbox-internal.h	Sun Aug 24 23:17:08 2008
@@ -1,6 +1,6 @@
 
 /* Ekiga -- A VoIP and Video-Conferencing application
- * Copyright (C) 2000-2006 Damien Sandras
+ * Copyright (C) 2000-2008 Damien Sandras
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -27,21 +27,21 @@
 
 
 /*
- *                         toolbox-gnome.c  -  description 
+ *                         toolbox-internal.h  -  description 
  *                         ------------------------------------------
- *   begin                : Dec 2005
- *   copyright            : (C) 2005 by Julien Puydt
- *   description          : Various helper functions -- gnome implementation
+ *   begin                : Aug 2008
+ *   copyright            : (C) 2008 by Julien Puydt
+ *   description          : Declaration of internal-use functions
  */
 
-#include "toolbox.h"
+#include <glib.h>
 
-#include <gnome.h>
+G_BEGIN_DECLS
 
-void
-gm_open_uri (const gchar *uri)
-{
-  g_return_if_fail (uri != NULL);
+/* DESCRIPTION  : /
+ * BEHAVIOR     : Allows to open an uri in a browser
+ * PRE		: Requires a non-NULL uri, but doesn't check
+ */
+void gm_open_uri_fallback (const gchar *uri);
 
-  gnome_url_show (uri, NULL);
-}
+G_END_DECLS



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