compilation fixes for older glib and gtk
authorVladimir Nadvornik <nadvornik@suse.cz>
Tue, 28 Apr 2009 06:54:59 +0000 (06:54 +0000)
committerVladimir Nadvornik <nadvornik@suse.cz>
Tue, 28 Apr 2009 06:54:59 +0000 (06:54 +0000)
src/bar_exif.c
src/compat.c
src/compat.h
src/main.h
src/utilops.c

index 143888a..4703674 100644 (file)
@@ -235,16 +235,12 @@ static void bar_pane_exif_update_entry(PaneExifData *ped, GtkWidget *entry, gboo
                        g_signal_handlers_block_by_func(ee->value_widget, bar_pane_exif_entry_changed, ee);
                        gtk_entry_set_text(GTK_ENTRY(ee->value_widget), text ? text : "");
                        g_signal_handlers_unblock_by_func(ee->value_widget, bar_pane_exif_entry_changed, ee);
-#if GTK_CHECK_VERSION(2,12,0)
                        gtk_widget_set_tooltip_text(ee->box, NULL);
-#endif
                        }
                else
                        {
                        gtk_label_set_text(GTK_LABEL(ee->value_widget), text);
-#if GTK_CHECK_VERSION(2,12,0)
                        gtk_widget_set_tooltip_text(ee->box, text);
-#endif
                        }
                gtk_widget_show(entry);
                ped->all_hidden = FALSE;
index b130a6c..1042801 100644 (file)
@@ -35,4 +35,24 @@ void radio_action_set_current_value(GtkRadioAction *action, gint current_value)
                }
 #endif
 }
+
+#if !GLIB_CHECK_VERSION(2, 14, 0)
+static void hash_table_add(gpointer key, gpointer value, gpointer user_data)
+{
+       GList **list = user_data;
+       *list = g_list_prepend(*list, key);
+}
+#endif
+
+GList* hash_table_get_keys(GHashTable *hash_table)
+{
+#if GLIB_CHECK_VERSION(2, 14, 0)
+       return g_hash_table_get_keys(hash_table);
+#else
+       GList *list = NULL;
+       g_hash_table_foreach(hash_table, hash_table_add, &list);
+       return list;
+#endif
+}
+
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 1a2c8dd..6652587 100644 (file)
 #define COMPAT_H
 
 void radio_action_set_current_value(GtkRadioAction *action, gint current_value);
+GList* hash_table_get_keys(GHashTable *hash_table);
+
+#if !GTK_CHECK_VERSION(2,12,0)
+#define gtk_widget_set_tooltip_text(widget, text) /* ignored */
+#endif
+
 
 #endif /* COMPAT_H */
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index e05ac7c..b28c2b6 100644 (file)
@@ -57,6 +57,7 @@
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <gdk-pixbuf/gdk-pixbuf-loader.h>
 
+#include "compat.h"
 
 /*
  *----------------------------------------------------------------------------
index 908c1c1..c51e121 100644 (file)
@@ -1834,7 +1834,7 @@ static void file_util_write_metadata_details_dialog(UtilityData *ud, FileData *f
        
        if (fd && fd->modified_xmp)
                {
-               keys = g_hash_table_get_keys(fd->modified_xmp);
+               keys = hash_table_get_keys(fd->modified_xmp);
                }
        
        g_assert(keys);