[gthumb] Remove deprecated Glib symbols - bug 581512



commit a37b54ff17a4617bd41862fc1b7f7666c89ff4e2
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date:   Tue May 19 10:56:27 2009 -0400

    Remove deprecated Glib symbols - bug 581512
---
 libgthumb/gth-sort-utils.c |   34 ++++++++++++++++++++++++++++------
 libgthumb/gth-sort-utils.h |    2 ++
 src/albumtheme.c           |    2 +-
 src/dlg-tags.c             |    4 ++--
 4 files changed, 33 insertions(+), 9 deletions(-)

diff --git a/libgthumb/gth-sort-utils.c b/libgthumb/gth-sort-utils.c
index aa72965..acbffc3 100644
--- a/libgthumb/gth-sort-utils.c
+++ b/libgthumb/gth-sort-utils.c
@@ -36,6 +36,33 @@
 
 
 int
+case_insens_utf8_cmp (const char *string1,
+                      const char *string2)
+{
+	gchar    *case_insens1;
+	gchar    *case_insens2;
+	gboolean  result;
+
+	if ((string1 == NULL) && (string2 == NULL))
+                return 0;
+        if (string2 == NULL)
+                return 1;
+        if (string1 == NULL)
+                return -1;
+
+	case_insens1 = g_utf8_casefold (string1,-1);
+	case_insens2 = g_utf8_casefold (string2,-1);
+
+	result = g_utf8_collate (case_insens1, case_insens2);
+
+	g_free (case_insens1);
+	g_free (case_insens2);
+
+	return result;
+}
+
+
+int
 gth_sort_by_comment_then_name (const char *string1,
 			       const char *string2,
 			       const char *name1,
@@ -48,13 +75,8 @@ gth_sort_by_comment_then_name (const char *string1,
 
 	if ((string1 == NULL) && (string2 == NULL))
                 return name_result;
-        if (string2 == NULL)
-                return 1;
-        if (string1 == NULL)
-                return -1;
-
-	collate_result = g_utf8_collate ( g_utf8_casefold (string1,-1), g_utf8_casefold (string2,-1) );
 
+	collate_result = case_insens_utf8_cmp (string1, string2);
 	if (collate_result)
 		return collate_result;
 	else
diff --git a/libgthumb/gth-sort-utils.h b/libgthumb/gth-sort-utils.h
index dab002d..f3216c7 100644
--- a/libgthumb/gth-sort-utils.h
+++ b/libgthumb/gth-sort-utils.h
@@ -25,6 +25,8 @@
 
 #include "file-data.h"
 
+int case_insens_utf8_cmp                 (const char       *string1,
+                                          const char       *string2);
 int gth_sort_by_comment_then_name        (const char       *string1, 
 					  const char       *string2,
 			                  const char       *name1, 
diff --git a/src/albumtheme.c b/src/albumtheme.c
index 4d5d72f..0cc4c40 100644
--- a/src/albumtheme.c
+++ b/src/albumtheme.c
@@ -1960,7 +1960,7 @@ yyreduce:
 #line 355 "albumtheme.y"
       {
 	GString *s = g_string_new ("");
-	g_string_sprintf (s, " %i", (yyvsp[(1) - (1)].ivalue));
+	g_string_printf (s, " %i", (yyvsp[(1) - (1)].ivalue));
 	(yyval.string) = s;
 	;
       }
diff --git a/src/dlg-tags.c b/src/dlg-tags.c
index 4b0ebc3..f485897 100644
--- a/src/dlg-tags.c
+++ b/src/dlg-tags.c
@@ -40,7 +40,7 @@
 #include "gth-file-view.h"
 #include "comments.h"
 #include "dlg-tags.h"
-
+#include "gth-sort-utils.h"
 
 typedef void (*SaveFunc) (GList *file_list, gpointer data);
 
@@ -462,7 +462,7 @@ keyword_equal_func (GtkTreeModel *model,
 {
 	char *cell;
 	gtk_tree_model_get (model, iter, column, &cell, -1);
-	return g_strcasecmp (key, cell) > 0;
+	return case_insens_utf8_cmp (key, cell) > 0;
 }
 
 



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