gok r2685 - in trunk: . gok



Author: gerdk
Date: Mon Mar 16 19:56:37 2009
New Revision: 2685
URL: http://svn.gnome.org/viewvc/gok?rev=2685&view=rev

Log:
2009-03-16  Gerd Kohlberger  <gerdk svn gnome org>

	* gok/main.c: (gok_main_read_keyboards_from_dir):
	Use g_get_language_names instead of the deprecated
	gnome_i18n_get_language_list. Fixes bug #570723.



Modified:
   trunk/ChangeLog
   trunk/gok/main.c

Modified: trunk/gok/main.c
==============================================================================
--- trunk/gok/main.c	(original)
+++ trunk/gok/main.c	Mon Mar 16 19:56:37 2009
@@ -32,6 +32,7 @@
 #include <signal.h>
 #include <gnome.h>
 #include <glib/gstdio.h>
+#include <glib/gi18n.h>
 #include <cspi/spi.h>
 #include <libbonobo.h>
 #include <bonobo-activation/bonobo-activation.h>
@@ -2178,7 +2179,7 @@
 	struct dirent* pDirectoryEntry;
 	gchar* filename;
 	gchar* complete_path;
-	GList* langlist = NULL;
+	const gchar * const *langlist;
 	gchar *dirtemp;
 
 	gok_log_enter();
@@ -2186,18 +2187,13 @@
 	pDirectoryKeyboards = NULL;
 
 	/* find the locale specific keyboards */
-	langlist = (GList*) gnome_i18n_get_language_list(NULL);
-	if (langlist != NULL) {
-		gint i = 0;
-		guint l = g_list_length(langlist);
-		while ((i < l)) {
-			dirtemp = g_build_filename (directory, g_list_nth_data(langlist, i), NULL);
-			pDirectoryKeyboards = opendir (dirtemp);
-			if (pDirectoryKeyboards) 
-				break;
-			g_free (dirtemp);
-			i++;
-		}
+	langlist = g_get_language_names ();
+	while (*langlist) {
+		dirtemp = g_build_filename (directory, *langlist++, NULL);
+		pDirectoryKeyboards = opendir (dirtemp);
+		if (pDirectoryKeyboards) 
+			break;
+		g_free (dirtemp);
 	}
 
 	if (pDirectoryKeyboards == NULL) { /* no locale specific directory found */



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