[gthumb] only use code specific to GNOME 3.0 or higher



commit 60dadc6c4c3254a60a441504e31dcf4b647262ec
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Nov 13 14:58:28 2011 +0100

    only use code specific to GNOME 3.0 or higher

 configure.ac                            |   11 --
 extensions/desktop_background/actions.c |   41 ------
 gthumb/gnome-desktop-thumbnail.c        |  213 -------------------------------
 3 files changed, 0 insertions(+), 265 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ab4da10..42882e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -236,16 +236,6 @@ AM_CONDITIONAL(ENABLE_LIBCHAMPLAIN, test "x$enable_libchamplain" = xyes)
 
 dnl ===========================================================================
 
-AC_ARG_ENABLE([gnome-3],
-	      [AS_HELP_STRING([--disable-gnome-3],[do not compile code specific to GNOME Desktop version 3.0 or higher])],,
-	      [enable_gnome_3=yes])
-
-if test x$enable_gnome_3 = xyes ; then
-	AC_DEFINE(HAVE_GNOME_3, 1, [Define to 1 if gthumb is intended to be used with GNOME Desktop 3.0 or higher])
-fi
-
-dnl ===========================================================================
-
 IT_PROG_INTLTOOL([0.35.0])
 GETTEXT_PACKAGE=gthumb
 AC_SUBST([GETTEXT_PACKAGE])
@@ -724,5 +714,4 @@ Configuration:
 	Web albums           : ${enable_web_albums}
 	SM client support    : ${with_smclient}
 	Map support          : ${enable_libchamplain}
-	GNOME 3 support      : ${enable_gnome_3}
 "
diff --git a/extensions/desktop_background/actions.c b/extensions/desktop_background/actions.c
index 3b6297c..da938a1 100644
--- a/extensions/desktop_background/actions.c
+++ b/extensions/desktop_background/actions.c
@@ -26,9 +26,6 @@
 #include <extensions/image_viewer/gth-image-viewer-page.h>
 
 
-#ifdef HAVE_GNOME_3
-
-
 #define DESKTOP_BACKGROUND_PROPERTIES_COMMAND "gnome-control-center background"
 #define DESKTOP_BACKGROUND_SCHEMA "org.gnome.desktop.background"
 #define DESKTOP_BACKGROUND_KEY "picture-uri"
@@ -71,44 +68,6 @@ set_current_wallpaper_file (GFile *file)
 }
 
 
-#else /* ! HAVE_GNOME_DESKTOP_3 */
-
-
-#define DESKTOP_BACKGROUND_PROPERTIES_COMMAND "gnome-appearance-properties --show-page=background"
-
-
-static GFile *
-get_current_wallpaper (void)
-{
-	GFile *file = NULL;
-	char  *path;
-
-	path = eel_gconf_get_string ("/desktop/gnome/background/picture_filename", NULL);
-	if (path != NULL) {
-		file = g_file_new_for_path (path);
-		g_free (path);
-	}
-
-	return file;
-}
-
-
-static void
-set_current_wallpaper_file (GFile *file)
-{
-	char *path;
-
-	path = g_file_get_path (file);
-	if (path != NULL)
-		eel_gconf_set_string ("/desktop/gnome/background/picture_filename", path);
-
-	g_free (path);
-}
-
-
-#endif
-
-
 typedef struct {
 	GthBrowser *browser;
 	GFile      *old_file;
diff --git a/gthumb/gnome-desktop-thumbnail.c b/gthumb/gnome-desktop-thumbnail.c
index d5cdec6..1c19adf 100644
--- a/gthumb/gnome-desktop-thumbnail.c
+++ b/gthumb/gnome-desktop-thumbnail.c
@@ -73,8 +73,6 @@ struct _GnomeDesktopThumbnailFactoryPrivate {
 
   GMutex *lock;
 
-#ifdef HAVE_GNOME_3
-
   GList *thumbnailers;
   GHashTable *mime_types_map;
   GList *monitors;
@@ -83,14 +81,6 @@ struct _GnomeDesktopThumbnailFactoryPrivate {
   gboolean loaded : 1;
   gboolean disabled : 1;
   gchar **disabled_types;
-
-#else /* ! HAVE_GNOME_3 */
-
-  GHashTable *scripts_hash;
-  guint thumbnailers_notify;
-  guint reread_scheduled;
-
-#endif
 };
 
 static const char *appname = "gnome-thumbnail-factory";
@@ -288,10 +278,6 @@ _gdk_pixbuf_new_from_uri_at_scale (const char   *uri,
 	return pixbuf;
 }
 
-
-#ifdef HAVE_GNOME_3
-
-
 #define LOAD_BUFFER_SIZE 4096
 
 #define THUMBNAILER_ENTRY_GROUP "Thumbnailer Entry"
@@ -776,205 +762,6 @@ gnome_desktop_thumbnail_factory_get_script (GnomeDesktopThumbnailFactory *factor
 }
 
 
-#else /* ! HAVE_GNOME_3 */
-
-
-/* Must be called on main thread */
-static GHashTable *
-read_scripts (void)
-{
-  GHashTable *scripts_hash;
-  GConfClient *client;
-  GSList *subdirs, *l;
-  char *subdir, *enable, *escape, *commandkey, *command, *mimetype;
-
-  client = gconf_client_get_default ();
-
-  if (gconf_client_get_bool (client,
-			     "/desktop/gnome/thumbnailers/disable_all",
-			     NULL))
-    {
-      g_object_unref (G_OBJECT (client));
-      return NULL;
-    }
-
-  scripts_hash = g_hash_table_new_full (g_str_hash,
-					g_str_equal,
-					g_free, g_free);
-
-
-  subdirs = gconf_client_all_dirs (client, "/desktop/gnome/thumbnailers", NULL);
-
-  for (l = subdirs; l != NULL; l = l->next)
-    {
-      subdir = l->data;
-
-      enable = g_strdup_printf ("%s/enable", subdir);
-      if (gconf_client_get_bool (client,
-				 enable,
-				 NULL))
-	{
-	  commandkey = g_strdup_printf ("%s/command", subdir);
-	  command = gconf_client_get_string (client, commandkey, NULL);
-	  g_free (commandkey);
-
-	  if (command != NULL) {
-	    mimetype = strrchr (subdir, '/');
-	    if (mimetype != NULL)
-	      {
-		mimetype++; /* skip past slash */
-
-		/* Convert '@' to slash in mimetype */
-		escape = strchr (mimetype, '@');
-		if (escape != NULL)
-		  *escape = '/';
-
-		/* Convert any remaining '@' to '+' in mimetype */
-		while ((escape = strchr (mimetype, '@')) != NULL)
-                  *escape = '+';
-
-		g_hash_table_insert (scripts_hash,
-				     g_strdup (mimetype), command);
-	      }
-	    else
-	      {
-		g_free (command);
-	      }
-	  }
-	}
-      g_free (enable);
-
-      g_free (subdir);
-    }
-
-  g_slist_free(subdirs);
-
-  g_object_unref (G_OBJECT (client));
-
-  return scripts_hash;
-}
-
-
-/* Must be called on main thread */
-static void
-gnome_desktop_thumbnail_factory_reread_scripts (GnomeDesktopThumbnailFactory *factory)
-{
-  GnomeDesktopThumbnailFactoryPrivate *priv = factory->priv;
-  GHashTable *scripts_hash;
-
-  scripts_hash = read_scripts ();
-
-  g_mutex_lock (priv->lock);
-
-  if (priv->scripts_hash != NULL)
-    g_hash_table_destroy (priv->scripts_hash);
-
-  priv->scripts_hash = scripts_hash;
-
-  g_mutex_unlock (priv->lock);
-}
-
-
-static gboolean
-reread_idle_callback (gpointer user_data)
-{
-  GnomeDesktopThumbnailFactory *factory = user_data;
-  GnomeDesktopThumbnailFactoryPrivate *priv = factory->priv;
-
-  gnome_desktop_thumbnail_factory_reread_scripts (factory);
-
-  g_mutex_lock (priv->lock);
-  priv->reread_scheduled = 0;
-  g_mutex_unlock (priv->lock);
-
-  return FALSE;
-}
-
-static void
-schedule_reread (GConfClient* client,
-		 guint cnxn_id,
-		 GConfEntry *entry,
-		 gpointer user_data)
-{
-  GnomeDesktopThumbnailFactory *factory = user_data;
-  GnomeDesktopThumbnailFactoryPrivate *priv = factory->priv;
-
-  g_mutex_lock (priv->lock);
-
-  if (priv->reread_scheduled == 0)
-    {
-      priv->reread_scheduled = g_idle_add (reread_idle_callback,
-					   factory);
-    }
-
-  g_mutex_unlock (priv->lock);
-}
-
-
-static void
-gnome_desktop_thumbnail_factory_init_scripts (GnomeDesktopThumbnailFactory *factory)
-{
-	GConfClient *client;
-
-	factory->priv->scripts_hash = NULL;
-
-	client = gconf_client_get_default ();
-	gconf_client_add_dir (client,
-			      "/desktop/gnome/thumbnailers",
-			      GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);
-
-	gnome_desktop_thumbnail_factory_reread_scripts (factory);
-
-	factory->priv->thumbnailers_notify = gconf_client_notify_add (client, "/desktop/gnome/thumbnailers",
-								      schedule_reread, factory, NULL,
-								      NULL);
-
-	g_object_unref (G_OBJECT (client));
-}
-
-
-static void
-gnome_desktop_thumbnail_factory_finalize_scripts (GnomeDesktopThumbnailFactory *factory)
-{
-	if (factory->priv->scripts_hash) {
-		g_hash_table_destroy (factory->priv->scripts_hash);
-		factory->priv->scripts_hash = NULL;
-	}
-
-	if (factory->priv->reread_scheduled != 0) {
-		g_source_remove (factory->priv->reread_scheduled);
-		factory->priv->reread_scheduled = 0;
-	}
-
-	if (factory->priv->thumbnailers_notify != 0) {
-		GConfClient *client;
-
-		client = gconf_client_get_default ();
-		gconf_client_notify_remove (client, factory->priv->thumbnailers_notify);
-		factory->priv->thumbnailers_notify = 0;
-		g_object_unref (client);
-	}
-}
-
-
-static char *
-gnome_desktop_thumbnail_factory_get_script (GnomeDesktopThumbnailFactory *factory,
-					    const char                   *mime_type)
-{
-	char *script = NULL;
-
-	if (factory->priv->scripts_hash != NULL) {
-		script = g_hash_table_lookup (factory->priv->scripts_hash, mime_type);
-		if (script)
-			script = g_strdup (script);
-	}
-
-	return script;
-}
-
-#endif
-
-
 static void
 gnome_desktop_thumbnail_factory_finalize (GObject *object)
 {



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