[Goodies-commits] r6103 - in xfce4-dict/trunk: . lib

Enrico Troeger enrico at xfce.org
Sat Nov 15 11:19:20 CET 2008


Author: enrico
Date: 2008-11-15 10:19:20 +0000 (Sat, 15 Nov 2008)
New Revision: 6103

Modified:
   xfce4-dict/trunk/ChangeLog
   xfce4-dict/trunk/lib/spell.c
Log:
Sort the spell check dictionary list in the prefs dialog.

Modified: xfce4-dict/trunk/ChangeLog
===================================================================
--- xfce4-dict/trunk/ChangeLog	2008-11-15 10:19:17 UTC (rev 6102)
+++ xfce4-dict/trunk/ChangeLog	2008-11-15 10:19:20 UTC (rev 6103)
@@ -3,6 +3,7 @@
  * Avoid leaving zombie processes when using spell checking (bug 4615).
  * Fix crashes when using the dictionary refresh button in the prefs
    dialog and while using enchant as spell checker.
+ * Sort the spell check dictionary list in the prefs dialog.
 
 
 2008-11-14  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>

Modified: xfce4-dict/trunk/lib/spell.c
===================================================================
--- xfce4-dict/trunk/lib/spell.c	2008-11-15 10:19:17 UTC (rev 6102)
+++ xfce4-dict/trunk/lib/spell.c	2008-11-15 10:19:20 UTC (rev 6103)
@@ -257,6 +257,12 @@
 }
 
 
+static gint sort_dicts(gconstpointer a, gconstpointer b)
+{	/* casting mania ;-) */
+	return strcmp((gchar*)((GPtrArray*)a)->pdata, (gchar*)((GPtrArray*)b)->pdata);
+}
+
+
 static gchar **get_enchant_dicts(const gchar *str)
 {
 	gchar **list = g_strsplit_set(str, "\r\n", -1);
@@ -273,6 +279,9 @@
 
 	g_strfreev(list);
 
+	/* sort the dictionary list */
+	g_ptr_array_sort(dicts, sort_dicts);
+	
 	list = g_new0(gchar *, dicts->len + 1);
 	for (i = 0; i < dicts->len; i++)
 	{




More information about the Goodies-commits mailing list