Author: jannis
Date: 2006-11-06 21:19:40 +0000 (Mon, 06 Nov 2006)
New Revision: 23764

Modified:
   libfrap/trunk/libfrap/menu/ChangeLog
   libfrap/trunk/libfrap/menu/frap-menu-item-cache.c
   libfrap/trunk/libfrap/menu/frap-menu-item-pool.c
   libfrap/trunk/libfrap/menu/frap-menu-standard-rules.c
   libfrap/trunk/libfrap/menu/frap-menu.c
Log:
        * frap-menu.c, frap-menu-standard-rules.c, frap-menu-item-pool.c, 
          frap-menu-item-cache.c: Apply patch by Jannis Pohlmann which makes
          FrapMenu compatible with GLib < 2.12.

Modified: libfrap/trunk/libfrap/menu/ChangeLog
===================================================================
--- libfrap/trunk/libfrap/menu/ChangeLog        2006-11-06 19:10:39 UTC (rev 
23763)
+++ libfrap/trunk/libfrap/menu/ChangeLog        2006-11-06 21:19:40 UTC (rev 
23764)
@@ -1,3 +1,9 @@
+2006-11-06     Jannis Pohlmann <[EMAIL PROTECTED]>
+
+       * frap-menu.c, frap-menu-standard-rules.c, frap-menu-item-pool.c, 
+         frap-menu-item-cache.c: Apply patch by Jannis Pohlmann which makes
+         FrapMenu compatible with GLib < 2.12.
+
 2006-11-03     Jannis Pohlmann <[EMAIL PROTECTED]>
 
        * frap-menu.{c,h}, frap-menu-move.{c,h}, Makefile.am, STATUS: 

Modified: libfrap/trunk/libfrap/menu/frap-menu-item-cache.c
===================================================================
--- libfrap/trunk/libfrap/menu/frap-menu-item-cache.c   2006-11-06 19:10:39 UTC 
(rev 23763)
+++ libfrap/trunk/libfrap/menu/frap-menu-item-cache.c   2006-11-06 21:19:40 UTC 
(rev 23764)
@@ -1,5 +1,5 @@
 /* $Id$ */
-/* vi:set expandtab sw=2 sts=2: */
+/* vi:set expandtab sw=2 sts=2 et: */
 /*-
  * Copyright (c) 2006 Jannis Pohlmann <[EMAIL PROTECTED]>
  *
@@ -39,10 +39,10 @@
 #include <string.h>
 #endif
 
+#include <libxfce4util/libxfce4util.h>
+
 #include <tdb/tdb.h>
 
-#include <libxfce4util/libxfce4util.h>
-
 #include <frap-menu-item.h>
 #include <frap-menu-item-cache.h>
 
@@ -214,7 +214,11 @@
   FrapMenuItemCache *cache = FRAP_MENU_ITEM_CACHE (object);
 
   /* Free hash table */
+#if GLIB_CHECK_VERSION(2,10,0)
   g_hash_table_unref (cache->priv->items);
+#else
+  g_hash_table_destroy (cache->priv->items);
+#endif
 
   /* Close TDB database */
   if (G_LIKELY (cache->priv->context != NULL))

Modified: libfrap/trunk/libfrap/menu/frap-menu-item-pool.c
===================================================================
--- libfrap/trunk/libfrap/menu/frap-menu-item-pool.c    2006-11-06 19:10:39 UTC 
(rev 23763)
+++ libfrap/trunk/libfrap/menu/frap-menu-item-pool.c    2006-11-06 21:19:40 UTC 
(rev 23764)
@@ -127,7 +127,11 @@
 {
   FrapMenuItemPool *pool = FRAP_MENU_ITEM_POOL (object);
 
+#if GLIB_CHECK_VERSION(2,10,0)
   g_hash_table_unref (pool->priv->items);
+#else
+  g_hash_table_destroy (pool->priv->items);
+#endif
 
   (*G_OBJECT_CLASS (frap_menu_item_pool_parent_class)->finalize) (object);
 }
@@ -195,7 +199,11 @@
 
   /* If rules are empty, remove all items */
   if (G_UNLIKELY (g_slist_length (rules) == 0))
+#if GLIB_CHECK_VERSION(2,12,0)    
     g_hash_table_remove_all (pool->priv->items);
+#else
+    g_hash_table_foreach_remove (pool->priv->items, (GHRFunc) g_object_unref, 
NULL);
+#endif
   else 
    g_hash_table_foreach_remove (pool->priv->items, (GHRFunc) 
frap_menu_item_pool_filter_item, rules);
 }

Modified: libfrap/trunk/libfrap/menu/frap-menu-standard-rules.c
===================================================================
--- libfrap/trunk/libfrap/menu/frap-menu-standard-rules.c       2006-11-06 
19:10:39 UTC (rev 23763)
+++ libfrap/trunk/libfrap/menu/frap-menu-standard-rules.c       2006-11-06 
21:19:40 UTC (rev 23764)
@@ -235,7 +235,11 @@
   g_return_if_fail (FRAP_IS_MENU_RULES (additional_rules));
 
   /* Remove floating reference (if any) and request a normal one */
+#if GLIB_CHECK_VERSION(2,10,0)
   g_object_ref_sink (G_OBJECT (additional_rules));
+#else
+  g_object_ref (G_OBJECT (additional_rules));
+#endif
 
   /* Append rules to the list */
   std_rules->rules = g_list_append (std_rules->rules, additional_rules);

Modified: libfrap/trunk/libfrap/menu/frap-menu.c
===================================================================
--- libfrap/trunk/libfrap/menu/frap-menu.c      2006-11-06 19:10:39 UTC (rev 
23763)
+++ libfrap/trunk/libfrap/menu/frap-menu.c      2006-11-06 21:19:40 UTC (rev 
23764)
@@ -1,5 +1,5 @@
 /* $Id$ */
-/* vi:set expandtab sw=2 sts=2: */
+/* vi:set expandtab sw=2 sts=2 et: */
 /*-
  * Copyright (c) 2006 Jannis Pohlmann <[EMAIL PROTECTED]>
  *
@@ -750,7 +750,11 @@
     g_object_unref (menu->priv->directory);
 
   /* Remove the floating reference and acquire a normal one */
+#if GLIB_CHECK_VERSION(2,10,0)
   g_object_ref_sink (G_OBJECT (directory));
+#else
+  g_object_ref (G_OBJECT (directory));
+#endif
 
   /* Set the new directory */
   menu->priv->directory = directory;
@@ -1602,7 +1606,11 @@
   g_return_if_fail (FRAP_IS_MENU (submenu));
 
   /* Remove floating reference and acquire a 'real' one */
+#if GLIB_CHECK_VERSION (2,10,0)
   g_object_ref_sink (G_OBJECT (submenu));
+#else
+  g_object_ref (G_OBJECT (submenu));
+#endif
 
   /* Append menu to the list */
   menu->priv->submenus = g_slist_append (menu->priv->submenus, submenu);
@@ -1736,7 +1744,11 @@
   menu->priv->submenus = merged_submenus;
 
   /* Free hash table */
+#if GLIB_CHECK_VERSION(2,10,0)  
   g_hash_table_unref (groups);
+#else
+  g_hash_table_destroy (groups);
+#endif
 }
 
 

_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to