[Xfce4-commits] <thunar:nick/1.8> Remove GLIB check macros that are not needed anymore.

Nick Schermer noreply at xfce.org
Sun Aug 4 21:52:10 CEST 2013


Updating branch refs/heads/nick/1.8
         to 9f2040763c3661ac865a798281d720b0df1e0fd0 (commit)
       from ad6ede32e8cd6ec42622b345687301153ce4d50c (commit)

commit 9f2040763c3661ac865a798281d720b0df1e0fd0
Author: Nick Schermer <nick at xfce.org>
Date:   Sun Aug 4 01:37:58 2013 +0200

    Remove GLIB check macros that are not needed anymore.

 thunar/main.c                   |    6 ------
 thunar/thunar-thumbnail-cache.c |   20 +++-----------------
 thunar/thunar-thumbnailer.c     |   20 ++------------------
 thunarx/thunarx-file-info.c     |    9 ---------
 4 files changed, 5 insertions(+), 50 deletions(-)

diff --git a/thunar/main.c b/thunar/main.c
index 4c31953..cbb9a2f 100644
--- a/thunar/main.c
+++ b/thunar/main.c
@@ -133,12 +133,6 @@ main (int argc, char **argv)
    */
   g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);
 #endif
-
-#if !GLIB_CHECK_VERSION (2, 32, 0)
-  /* initialize the GThread system */
-  if (!g_thread_supported ())
-    g_thread_init (NULL);
-#endif
     
   /* get the startup notification id */
   startup_id = g_getenv ("DESKTOP_STARTUP_ID");
diff --git a/thunar/thunar-thumbnail-cache.c b/thunar/thunar-thumbnail-cache.c
index 348ec53..6ca4d67 100644
--- a/thunar/thunar-thumbnail-cache.c
+++ b/thunar/thunar-thumbnail-cache.c
@@ -37,13 +37,11 @@
 #include <thunar/thunar-thumbnail-cache.h>
 #include <thunar/thunar-file.h>
 
-#if GLIB_CHECK_VERSION (2, 32, 0)
+
+
+
 #define _thumbnail_cache_lock(cache)   g_mutex_lock (&((cache)->lock))
 #define _thumbnail_cache_unlock(cache) g_mutex_unlock (&((cache)->lock))
-#else
-#define _thumbnail_cache_lock(cache)   g_mutex_lock ((cache)->lock)
-#define _thumbnail_cache_unlock(cache) g_mutex_unlock ((cache)->lock)
-#endif
 
 
 
@@ -77,11 +75,7 @@ struct _ThunarThumbnailCache
   GList      *cleanup_queue;
   guint       cleanup_queue_idle_id;
 
-#if GLIB_CHECK_VERSION (2, 32, 0)
   GMutex      lock;
-#else
-  GMutex     *lock;
-#endif
 #endif
 };
 
@@ -127,11 +121,7 @@ thunar_thumbnail_cache_init (ThunarThumbnailCache *cache)
     }
 
 /* create a new mutex for accessing the cache from different threads */
-#if GLIB_CHECK_VERSION (2, 32, 0)
   g_mutex_init (&cache->lock);
-#else
-  cache->lock = g_mutex_new ();
-#endif
 #endif
 }
 
@@ -176,11 +166,7 @@ thunar_thumbnail_cache_finalize (GObject *object)
   _thumbnail_cache_unlock (cache);
 
   /* release the mutex itself */
-#if GLIB_CHECK_VERSION (2, 32, 0)
   g_mutex_clear (&cache->lock);
-#else
-  g_mutex_free (cache->lock);
-#endif
 #endif
 
   (*G_OBJECT_CLASS (thunar_thumbnail_cache_parent_class)->finalize) (object);
diff --git a/thunar/thunar-thumbnailer.c b/thunar/thunar-thumbnailer.c
index 308e109..e311f12 100644
--- a/thunar/thunar-thumbnailer.c
+++ b/thunar/thunar-thumbnailer.c
@@ -128,15 +128,11 @@ static gboolean               thunar_thumbnailer_idle_func              (gpointe
 static void                   thunar_thumbnailer_idle_free              (gpointer                    data);
 #endif
 
-#if GLIB_CHECK_VERSION (2, 32, 0)
+
+
 #define _thumbnailer_lock(thumbnailer)    g_mutex_lock (&((thumbnailer)->lock))
 #define _thumbnailer_unlock(thumbnailer)  g_mutex_unlock (&((thumbnailer)->lock))
 #define _thumbnailer_trylock(thumbnailer) g_mutex_trylock (&((thumbnailer)->lock))
-#else
-#define _thumbnailer_lock(thumbnailer)    g_mutex_lock ((thumbnailer)->lock)
-#define _thumbnailer_unlock(thumbnailer)  g_mutex_unlock ((thumbnailer)->lock)
-#define _thumbnailer_trylock(thumbnailer) g_mutex_trylock ((thumbnailer)->lock)
-#endif
 
 
 
@@ -156,11 +152,7 @@ struct _ThunarThumbnailer
   /* running jobs */
   GSList     *jobs;
 
-#if GLIB_CHECK_VERSION (2, 32, 0)
   GMutex      lock;
-#else
-  GMutex     *lock;
-#endif
 
   /* cached MIME types -> URI schemes for which thumbs can be generated */
   GHashTable *supported;
@@ -243,11 +235,7 @@ thunar_thumbnailer_init (ThunarThumbnailer *thumbnailer)
 #ifdef HAVE_DBUS
   DBusGConnection *connection;
 
-#if GLIB_CHECK_VERSION (2, 32, 0)
   g_mutex_init (&thumbnailer->lock);
-#else
-  thumbnailer->lock = g_mutex_new ();
-#endif
 
   /* try to connect to D-Bus */
   connection = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);
@@ -321,11 +309,7 @@ thunar_thumbnailer_finalize (GObject *object)
   _thumbnailer_unlock (thumbnailer);
 
 /* release the mutex */
-#if GLIB_CHECK_VERSION (2, 32, 0)
   g_mutex_clear (&thumbnailer->lock);
-#else
-  g_mutex_free (thumbnailer->lock);
-#endif
 #endif
 
   (*G_OBJECT_CLASS (thunar_thumbnailer_parent_class)->finalize) (object);
diff --git a/thunarx/thunarx-file-info.c b/thunarx/thunarx-file-info.c
index 623560a..08c3769 100644
--- a/thunarx/thunarx-file-info.c
+++ b/thunarx/thunarx-file-info.c
@@ -418,16 +418,7 @@ thunarx_file_info_list_get_type (void)
 GList*
 thunarx_file_info_list_copy (GList *file_infos)
 {
-#if GLIB_CHECK_VERSION (2, 34, 0)
   return g_list_copy_deep (file_infos, (GCopyFunc) g_object_ref, NULL);
-#else
-  GList *copy;
-
-  copy = g_list_copy (file_infos);
-  g_list_foreach (copy, (GFunc) g_object_ref, NULL);
-
-  return copy;
-#endif
 }
 
 


More information about the Xfce4-commits mailing list