[aisleriot] Require gtk+-3.0 and a recent glib



commit 9add2c815fdafcc26f5ed62db7323db0b18149ba
Author: Christian Persch <chpe gnome org>
Date:   Mon Apr 11 23:11:45 2011 +0200

    Require gtk+-3.0 and a recent glib

 configure.ac                    |   51 +--
 src/lib/Makefile.am             |   25 +-
 src/lib/ar-card-images.c        |  923 ---------------------------------------
 src/lib/ar-card-images.h        |  123 ------
 src/lib/ar-card-surface-cache.c |    5 +-
 src/lib/ar-card-theme-private.h |    2 -
 src/lib/ar-card-theme-svg.c     |    4 -
 src/lib/ar-card-theme.c         |   39 --
 src/lib/ar-card-theme.h         |    4 -
 src/lib/ar-conf.c               |   33 +-
 src/lib/ar-gsettings.c          |    1 -
 src/lib/ar-runtime.c            |   53 ---
 src/lib/ar-show.c               |   32 --
 13 files changed, 24 insertions(+), 1271 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index eea9aee..99751b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,18 +119,16 @@ fi
 
 AC_MSG_CHECKING([which gtk+ version to compile against])
 AC_ARG_WITH([gtk],
-  [AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against (default: 3.0)])],
+  [AS_HELP_STRING([--with-gtk=3.0],[which gtk+ version to compile against (default: 3.0)])],
   [case "$with_gtk" in
-     2.0|3.0) ;;
+     3.0) ;;
+     [0-9].0) AC_MSG_ERROR([unsupported gtk version $with_gtk specified]) ;;
      *) AC_MSG_ERROR([invalid gtk version specified]) ;;
    esac],
   [with_gtk=3.0])
 AC_MSG_RESULT([$with_gtk])
 
 case "$with_gtk" in
-  2.0) GTK_API_VERSION=2.0
-       GTK_API_MAJOR_VERSION=2
-       ;;
   3.0) GTK_API_VERSION=3.0
        GTK_API_MAJOR_VERSION=3
        ;;
@@ -139,9 +137,6 @@ esac
 AC_SUBST([GTK_API_VERSION])
 AC_SUBST([GTK_API_MAJOR_VERSION])
 
-AM_CONDITIONAL([HAVE_GTK_2],[test "$GTK_API_VERSION" = "2.0"])
-AM_CONDITIONAL([HAVE_GTK_3],[test "$GTK_API_VERSION" = "3.0"])
-
 # **************
 # Win32 platform
 # **************
@@ -361,18 +356,7 @@ AM_CONDITIONAL([ENABLE_DEBUG_UI],[test "$enable_debug_ui" = "yes"])
 # ********************
 
 case "$with_gtk" in
-  2.0) if test "$with_platform" = "hildon" -a "$with_platform_variant" = "maemo3"; then
-         GTK_REQUIRED=2.6.0
-       elif test "$require_gtk_2_16" = "yes"; then
-         GTK_REQUIRED=2.16.0
-       else
-         GTK_REQUIRED=2.8.0
-       fi
-       RSVG_REQUIRED=2.14.0
-       LIBCANBERRA_GTK_REQUIRED=0
-       LIBCANBERRA_GTK_PKGS="libcanberra-gtk >= $LIBCANBERRA_GTK_REQUIRED"
-        ;;
-  3.0) GTK_REQUIRED=2.91.7
+  3.0) GTK_REQUIRED=3.0.0
        RSVG_REQUIRED=2.32.0
        LIBCANBERRA_GTK_REQUIRED=0.26
        LIBCANBERRA_GTK_PKGS="libcanberra-gtk3 >= $LIBCANBERRA_GTK_REQUIRED"
@@ -380,7 +364,8 @@ case "$with_gtk" in
 esac
 
 GCONF_REQUIRED=2.0
-GIO_REQUIRED=2.25.7
+GLIB_REQUIRED=2.26.0
+GIO_REQUIRED=2.26.0
 GSTREAMER_REQUIRED=0.10.11
 HILDON_LIBS_REQUIRED=0.14
 HILDON_1_REQUIRED=1.00
@@ -404,15 +389,11 @@ PKG_CHECK_MODULES([GTK],[gtk+-$GTK_API_VERSION >= $GTK_REQUIRED])
 AC_SUBST([GTK_CFLAGS])
 AC_SUBST([GTK_LIBS])
 
-# GDBus
-
-PKG_CHECK_MODULES([GIO],[gio-2.0 >= $GIO_REQUIRED],[have_gio_2_26=yes],[have_gio_2_26=no])
-
+# *********
 # GSettings
+# *********
 
-AM_CONDITIONAL([HAVE_GIO_2_26],[test "$have_gio_2_26" = "yes"])
-
-m4_ifdef([GLIB_GSETTINGS],[GLIB_GSETTINGS([],[:])])
+GLIB_GSETTINGS
 
 # Check for GNOME modules
 
@@ -466,16 +447,6 @@ if test "$need_rsvg" = "yes"; then
   AC_SUBST([RSVG_LIBS])
 
   AC_DEFINE([HAVE_RSVG],[1],[Refine if librsvg is available])
-
-  # This only existed in some pre-gio rsvg versions
-  if test "$with_gtk" = "2.0"; then
-    rsvg_gnomevfs=$($PKG_CONFIG --variable=gnome_vfs_supported librsvg-2.0)
-    if test "$rsvg_gnomevfs" = "yes"; then
-      AC_DEFINE([HAVE_RSVG_GNOMEVFS],[1],[Define if librsvg has gnome-vfs support])
-
-      need_gthread=yes
-    fi
-  fi
 fi
 
 AM_CONDITIONAL([HAVE_RSVG],[test "$have_rsvg" = "yes"])
@@ -490,9 +461,6 @@ if test "$with_clutter" = "yes"; then
   AC_SUBST([CLUTTER_LIBS])
 
   case "$with_gtk" in
-    2.0) CLUTTER_GTK_API_VERSION=0.10
-         CLUTTER_GTK_REQUIRED=0.10.2
-         ;;
     3.0) CLUTTER_GTK_API_VERSION=1.0
          CLUTTER_GTK_REQUIRED=0.91.6
          ;;
@@ -526,7 +494,6 @@ SMCLIENT_PKGS=
 
 AC_MSG_CHECKING([for GDK target])
 case "$with_gtk" in
-  2.0) GDK_TARGET="$($PKG_CONFIG --variable target gdk-$GTK_API_VERSION)" ;;
   3.0) for target in $($PKG_CONFIG --variable targets gdk-$GTK_API_VERSION); do
           GDK_TARGET="$target"
           break
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 0898ffa..922fbe3 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -20,6 +20,8 @@ libaisleriot_la_SOURCES = \
 	ar-conf.h \
 	ar-debug.c \
 	ar-debug.h \
+	ar-gsettings.c \
+	ar-gsettings.h \
 	ar-glib-compat.h \
 	ar-gtk-compat.h \
 	ar-help.c \
@@ -47,20 +49,6 @@ libaisleriot_la_SOURCES += \
 	$(NULL)
 endif
 
-if HAVE_GIO_2_26
-libaisleriot_la_SOURCES += \
-	ar-gsettings.c \
-	ar-gsettings.h \
-	$(NULL)
-endif
-
-if HAVE_GTK_2
-libaisleriot_la_SOURCES += \
-	ar-card-images.c \
-	ar-card-images.h \
-	$(NULL)
-endif
-
 # FIXME conditional
 libaisleriot_la_SOURCES += \
 	ar-card-surface-cache.c \
@@ -114,15 +102,12 @@ libaisleriot_la_CPPFLAGS = \
 
 libaisleriot_la_CFLAGS = \
 	$(GTK_CFLAGS) \
+	$(GIO_CFLAGS) \
 	$(AM_CFLAGS)
 
 libaisleriot_la_LIBADD = \
-	$(GTK_LIBS)
-
-if HAVE_GIO_2_26
-libaisleriot_la_CFLAGS += $(GIO_CFLAGS)
-libaisleriot_la_LIBADD += $(GIO_LIBS)
-endif # HAVE_GIO_2_26
+	$(GTK_LIBS) \
+	$(GIO_LIBS)
 
 if HAVE_RSVG
 libaisleriot_la_CFLAGS += $(RSVG_CFLAGS)
diff --git a/src/lib/ar-card-surface-cache.c b/src/lib/ar-card-surface-cache.c
index 29d5ec2..bfd2d84 100644
--- a/src/lib/ar-card-surface-cache.c
+++ b/src/lib/ar-card-surface-cache.c
@@ -329,13 +329,10 @@ ar_card_surface_cache_get_card_surface_by_id (ArCardSurfaceCache *cache,
 
     ar_card_theme_get_size (priv->theme, &card_size);
 
-#if GTK_CHECK_VERSION (2, 21, 6)
     if (priv->drawable != NULL) {
       surface = gdk_window_create_similar_surface (priv->drawable, CAIRO_CONTENT_COLOR_ALPHA,
                                                    card_size.width, card_size.height);
-    } else
-#endif /* GTK 2.21.6 */
-    {
+    } else {
       surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
                                             card_size.width, card_size.height);
     }
diff --git a/src/lib/ar-card-theme-private.h b/src/lib/ar-card-theme-private.h
index 3a88f88..d0a5e4e 100644
--- a/src/lib/ar-card-theme-private.h
+++ b/src/lib/ar-card-theme-private.h
@@ -84,13 +84,11 @@ struct _ArCardThemeClass {
   GdkPixbuf*  (* get_card_pixbuf)   (ArCardTheme *theme,
                                      int card_id);
 
-#if GTK_CHECK_VERSION (2, 10, 0)
   void        (* paint_card)        (ArCardTheme *theme,
                                      cairo_t *cr,
                                      int card_id);
   void        (* set_font_options)  (ArCardTheme *theme,
                                      const cairo_font_options_t *font_options);
-#endif
 };
 
 struct _ArCardTheme {
diff --git a/src/lib/ar-card-theme-svg.c b/src/lib/ar-card-theme-svg.c
index 630e44f..a0212d3 100644
--- a/src/lib/ar-card-theme-svg.c
+++ b/src/lib/ar-card-theme-svg.c
@@ -99,7 +99,6 @@ ar_card_theme_svg_get_card_pixbuf (ArCardTheme *card_theme,
   return subpixbuf;
 }
 
-#if GTK_CHECK_VERSION (2, 10,0)
 static void
 ar_card_theme_svg_paint_card (ArCardTheme *card_theme,
                               cairo_t *cr,
@@ -147,7 +146,6 @@ ar_card_theme_svg_paint_card (ArCardTheme *card_theme,
                                    offsetx, offsety,
                                    zoomx, zoomy);
 }
-#endif /* GTK 2.10 */
 
 static void
 ar_card_theme_svg_init (ArCardThemeSVG * cardtheme)
@@ -206,9 +204,7 @@ ar_card_theme_svg_class_init (ArCardThemeSVGClass * klass)
   theme_class->foreach_theme_dir = ar_card_theme_svg_class_foreach_theme_dir;
 
   theme_class->get_card_pixbuf = ar_card_theme_svg_get_card_pixbuf;
-#if GTK_CHECK_VERSION (2, 10, 0)
   theme_class->paint_card = ar_card_theme_svg_paint_card;
-#endif
 
   preimage_theme_class->needs_scalable_cards = TRUE;
 }
diff --git a/src/lib/ar-card-theme.c b/src/lib/ar-card-theme.c
index 2b7455b..f0e2b35 100644
--- a/src/lib/ar-card-theme.c
+++ b/src/lib/ar-card-theme.c
@@ -112,8 +112,6 @@ ar_card_theme_class_get_theme_info (ArCardThemeClass *klass,
   return NULL;
 }
 
-#if GTK_CHECK_VERSION (2, 10,0)
-
 /* This routine is copied from librsvg:
    Copyright © 2005 Dom Lachowicz <cinamod hotmail com>
    Copyright © 2005 Caleb Moore <c moore student unsw edu au>
@@ -223,8 +221,6 @@ ar_card_theme_class_real_get_card_pixbuf (ArCardTheme *card_theme,
                                    (GdkPixbufDestroyNotify) g_free, data);
 }
 
-#endif /* GTK 2.10 */
-
 static void
 ar_card_theme_class_init (ArCardThemeClass * klass)
 {
@@ -235,11 +231,8 @@ ar_card_theme_class_init (ArCardThemeClass * klass)
   gobject_class->finalize = ar_card_theme_finalize;
 
   klass->get_theme_info = ar_card_theme_class_get_theme_info;
-
-#if GTK_CHECK_VERSION (2, 10,0)
   klass->paint_card = ar_card_theme_class_real_paint_card;
   klass->get_card_pixbuf = ar_card_theme_class_real_get_card_pixbuf;
-#endif
 
   g_object_class_install_property
     (gobject_class,
@@ -332,8 +325,6 @@ _ar_card_theme_class_foreach_env (ArCardThemeClass *klass,
 
 /* public API */
 
-#if GTK_CHECK_VERSION (2, 10, 0)
-
 /**
  * ar_card_theme_set_font_options:
  * @theme:
@@ -353,9 +344,6 @@ ar_card_theme_set_font_options (ArCardTheme *theme,
   theme->klass->set_font_options (theme, font_options);
 }
 
-#endif /* GTK 2.10.0 */
-
-
 /**
  * ar_card_theme_get_theme_info:
  * @theme:
@@ -451,7 +439,6 @@ ar_card_theme_get_card_pixbuf (ArCardTheme *theme,
   return pixbuf;
 }
 
-#if GTK_CHECK_VERSION (2, 10,0)
 /**
  * ar_card_theme_paint_card:
  * @theme:
@@ -473,7 +460,6 @@ ar_card_theme_paint_card (ArCardTheme *theme,
 
   ar_profileend ("loading card %d from theme %s", cardid, theme->theme_info->display_name);
 }
-#endif /* GTK 2.10 */
 
 /* ArCardThemeInfo impl */
 
@@ -542,12 +528,7 @@ _ar_card_theme_info_new (GType type,
 {
   ArCardThemeInfo *info;
 
-#if GLIB_CHECK_VERSION (2, 10, 0)
   info = g_slice_new (ArCardThemeInfo);
-#else
-  info = g_new (ArCardThemeInfo, 1);
-#endif
-
   info->ref_count = 1;
   info->type = type;
   info->path = g_strdup (path);
@@ -597,25 +578,9 @@ _ar_card_theme_info_collate (const ArCardThemeInfo *a,
 
 /* public API */
 
-#if defined(G_DEFINE_BOXED_TYPE)
 G_DEFINE_BOXED_TYPE (ArCardThemeInfo, ar_card_theme_info,
                      ar_card_theme_info_ref,
                      ar_card_theme_info_unref);
-#else
-GType
-ar_card_theme_info_get_type (void)
-{
-  static GType type = 0;
-
-  if (G_UNLIKELY (type == 0)) {
-    type = g_boxed_type_register_static ("ArCardThemeInfo",
-                                         (GBoxedCopyFunc) ar_card_theme_info_ref,
-                                         (GBoxedFreeFunc) ar_card_theme_info_unref);
-  }
-
-  return type;
-}
-#endif /* defined(G_DEFINE_BOXED_TYPE) */
 
 /**
  * ar_card_theme_info_ref:
@@ -656,11 +621,7 @@ ar_card_theme_info_unref (ArCardThemeInfo *info)
   if (info->data && info->destroy_notify)
     info->destroy_notify (info->data);
 
-#if GLIB_CHECK_VERSION (2, 10, 0)
   g_slice_free (ArCardThemeInfo, info);
-#else
-  g_free (info);
-#endif
 }
 
 /**
diff --git a/src/lib/ar-card-theme.h b/src/lib/ar-card-theme.h
index 0f6fb93..6eca07d 100644
--- a/src/lib/ar-card-theme.h
+++ b/src/lib/ar-card-theme.h
@@ -73,10 +73,8 @@ typedef struct _ArCardTheme      ArCardTheme;
 
 GType ar_card_theme_get_type (void);
 
-#if GTK_CHECK_VERSION (2, 10, 0)
 void ar_card_theme_set_font_options (ArCardTheme *theme,
                                         const cairo_font_options_t *font_options);
-#endif
 
 gboolean ar_card_theme_set_theme (ArCardTheme *theme,
                                      ArCardThemeInfo *info);
@@ -96,11 +94,9 @@ double ar_card_theme_get_aspect (ArCardTheme * theme);
 GdkPixbuf *ar_card_theme_get_card_pixbuf (ArCardTheme * theme,
                                           int cardid);
 
-#if GTK_CHECK_VERSION (2, 10,0)
 void ar_card_theme_paint_card (ArCardTheme *theme,
                                 cairo_t *cr,
                                 int cardid);
-#endif
 
 G_END_DECLS
 
diff --git a/src/lib/ar-conf.c b/src/lib/ar-conf.c
index 76f8e3b..712c29d 100644
--- a/src/lib/ar-conf.c
+++ b/src/lib/ar-conf.c
@@ -23,13 +23,6 @@
 
 #include <gtk/gtk.h>
 
-#if GTK_CHECK_VERSION (2, 90, 7)
-#define GDK_KEY(symbol) GDK_KEY_##symbol
-#else
-#include <gdk/gdkkeysyms.h>
-#define GDK_KEY(symbol) GDK_##symbol
-#endif
-
 #ifdef HAVE_GNOME
 #include <gconf/gconf-client.h>
 #else
@@ -37,8 +30,6 @@
 #endif
 
 #include "ar-debug.h"
-#include "ar-glib-compat.h"
-#include "ar-gtk-compat.h"
 #include "ar-marshal.h"
 
 #include "ar-conf.h"
@@ -1106,14 +1097,10 @@ ar_conf_get_double (const char *group, const char *key,
   g_free (key_name);
 
   return value;
-#elif GLIB_CHECK_VERSION (2, 12, 0)
+#else
   ArConfPrivate *priv = instance->priv;
 
   return g_key_file_get_double (priv->key_file, group ? group : priv->main_group, key, error);
-#else
-#warning ar_conf_get_double not implemented on glib < 2.12!
-  /* Not supported */
-  return 0.0;
 #endif /* HAVE_GNOME */
 }
 
@@ -1135,13 +1122,11 @@ ar_conf_set_double (const char *group, const char *key, double value)
   key_name = get_gconf_key_name (group, key);
   gconf_client_set_float (priv->gconf_client, key_name, value, NULL);
   g_free (key_name);
-#elif GLIB_CHECK_VERSION (2, 12, 0)
+#else
   ArConfPrivate *priv = instance->priv;
 
   g_key_file_set_double (priv->key_file, group ? group : priv->main_group, key, value);
   g_signal_emit (instance, signals[VALUE_CHANGED], 0, group, key);
-#else
-#warning ar_conf_set_double not implemented on glib < 2.12!
 #endif /* HAVE_GNOME */
 }
 
@@ -1165,7 +1150,7 @@ ar_conf_get_keyval (const char *group, const char *key,
 #ifdef HAVE_GNOME
   GConfValueType type;
   char *key_name, *value;
-  guint keyval = GDK_KEY (VoidSymbol);
+  guint keyval = GDK_KEY_VoidSymbol;
 
   key_name = get_gconf_key_name (group, key);
   type = get_gconf_value_type_from_schema (key_name);
@@ -1174,7 +1159,7 @@ ar_conf_get_keyval (const char *group, const char *key,
   if (type == GCONF_VALUE_STRING) {
     value = gconf_client_get_string (priv->gconf_client, key_name, error);
     if (!value) {
-      keyval = GDK_KEY (VoidSymbol);
+      keyval = GDK_KEY_VoidSymbol;
     } else {
       keyval = gdk_keyval_from_name (value);
       g_free (value);
@@ -1182,7 +1167,7 @@ ar_conf_get_keyval (const char *group, const char *key,
   } else if (type == GCONF_VALUE_INT) {
     keyval = gconf_client_get_int (priv->gconf_client, key_name, error);
     if (*error || keyval == 0)
-      keyval = GDK_KEY (VoidSymbol);
+      keyval = GDK_KEY_VoidSymbol;
   } else {
     g_warning ("Unknown value type for key %s\n", key_name);
   }
@@ -1192,7 +1177,7 @@ ar_conf_get_keyval (const char *group, const char *key,
   return keyval;
 #else
   char *value;
-  guint keyval = GDK_KEY (VoidSymbol);
+  guint keyval = GDK_KEY_VoidSymbol;
 
   value = g_key_file_get_string (priv->key_file, group, key, error);
   if (value) {
@@ -1227,7 +1212,7 @@ ar_conf_get_keyval_with_default (const char *group, const char *key,
     g_error_free (error);
     value = default_keyval;
   }
-  if (value == GDK_KEY (VoidSymbol)) {
+  if (value == GDK_KEY_VoidSymbol) {
     value = default_keyval;
   }
 
@@ -1251,7 +1236,7 @@ ar_conf_set_keyval (const char *group, const char *key, guint value)
   GConfValueType type;
   char *key_name, *name;
 
-  if (value == GDK_KEY (VoidSymbol))
+  if (value == GDK_KEY_VoidSymbol)
     return;
 
   key_name = get_gconf_key_name (group, key);
@@ -1271,7 +1256,7 @@ ar_conf_set_keyval (const char *group, const char *key, guint value)
 #else
   char *name;
 
-  if (value == GDK_KEY (VoidSymbol))
+  if (value == GDK_KEY_VoidSymbol)
     return;
   
   name = gdk_keyval_name (value);
diff --git a/src/lib/ar-gsettings.c b/src/lib/ar-gsettings.c
index 7d6d5aa..8129d12 100644
--- a/src/lib/ar-gsettings.c
+++ b/src/lib/ar-gsettings.c
@@ -22,7 +22,6 @@
 
 #include <gtk/gtk.h>
 
-#include "ar-gtk-compat.h"
 #include "ar-debug.h"
 
 #define I_(string) g_intern_static_string (string)
diff --git a/src/lib/ar-runtime.c b/src/lib/ar-runtime.c
index 85ec219..0c90a54 100644
--- a/src/lib/ar-runtime.c
+++ b/src/lib/ar-runtime.c
@@ -245,54 +245,6 @@ static const DerivedDirectory derived_directories[] = {
 
 typedef int _assertion[G_N_ELEMENTS (derived_directories) + AR_RUNTIME_FIRST_DERIVED_DIRECTORY == AR_RUNTIME_LAST_DIRECTORY ? 1 : -1];
 
-#if !GTK_CHECK_VERSION (2, 17, 0)
-/* Since version 2.17.0, gtk has default about dialogue hook functions
- * using gtk_show_uri(). For earlier versions, we need to implement
- * our own hooks.
- */
-
-static void
-about_url_hook (GtkAboutDialog *about,
-                const char *uri,
-                gpointer user_data)
-{
-  GdkScreen *screen;
-  GError *error = NULL;
-
-  screen = gtk_widget_get_screen (GTK_WIDGET (about));
-
-  if (!ar_show_uri (screen, uri, gtk_get_current_event_time (), &error)) {
-    ar_show_error (GTK_WIDGET (about),
-                      error,
-                      "%s", _("Could not show link"));
-    g_error_free (error);
-  }
-}
-
-static void
-about_email_hook (GtkAboutDialog *about,
-                  const char *email_address,
-                  gpointer user_data)
-{
-  char *uri;
-
-#if GLIB_CHECK_VERSION (2, 16, 0)
-  char *escaped_email_address;
-
-  escaped_email_address = g_uri_escape_string (email_address, NULL, FALSE);
-  uri = g_strdup_printf ("mailto:%s";, escaped_email_address);
-  g_free (escaped_email_address);
-#else
-  /* Not really correct, but the best we can do */
-  uri = g_strdup_printf ("mailto:%s";, email_address);
-#endif
-
-  about_url_hook (about, uri, user_data);
-  g_free (uri);
-}
-
-#endif /* GTK < 2.17.0 */
-
 /* public API */
 
 /**
@@ -385,11 +337,6 @@ ar_runtime_init (const char *name)
     gpl_version = 2;
   }
 
-#if !GTK_CHECK_VERSION (2, 17, 0)
-  gtk_about_dialog_set_url_hook (about_url_hook, NULL, NULL);
-  gtk_about_dialog_set_email_hook (about_email_hook, NULL, NULL);
-#endif
-
   ar_profileend ("ar_runtime_init");
 
   return retval;
diff --git a/src/lib/ar-show.c b/src/lib/ar-show.c
index dcba64d..b6d4d16 100644
--- a/src/lib/ar-show.c
+++ b/src/lib/ar-show.c
@@ -75,39 +75,7 @@ ar_show_uri (GdkScreen *screen,
   return TRUE;
 #else /* !G_OS_WIN32 */
 
-#if GTK_CHECK_VERSION (2, 14, 0)
   return gtk_show_uri (screen, uri, timestamp, error);
-#else /* GTK+ < 2.14 */
-  char *argv[3] = { (char *) "xdg-open", (char *) uri, NULL };
- 
-  if (gdk_spawn_on_screen (screen,
-                           NULL /* working directory */,
-                           argv,
-                           NULL /* environment */,
-                           G_SPAWN_SEARCH_PATH,
-                           NULL, NULL,
-                           NULL,
-                           error))
-    return TRUE;
-
-  g_clear_error (error);
-
-  /* Try falling back to gnome-open */
-  argv[0] = (char *) "gnome-open";
-  if (gdk_spawn_on_screen (screen,
-                           NULL /* working directory */,
-                           argv,
-                           NULL /* environment */,
-                           G_SPAWN_SEARCH_PATH,
-                           NULL, NULL,
-                           NULL,
-                           error))
-    return TRUE;
-
-  g_set_error (error, G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED,
-               "%s", "Failed to show help");
-  return FALSE;
-#endif /* GTK+ >= 2.14 */
 #endif /* G_OS_WIN32 */
 #endif /* HAVE_MAEMO */
 }



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