X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dict.c;h=c4f30783552ebb19fc794b65683f0a51acbdbb5d;hb=90f346cc015bb89d28c93e35ba2e23d6671e14f2;hp=f23018421505a9ca6d497c97bcadfeb44872a6cd;hpb=176d797337156a8affdcacfb1dddf8a4de8c5545;p=pspp diff --git a/src/ui/gui/psppire-dict.c b/src/ui/gui/psppire-dict.c index f230184215..c4f3078355 100644 --- a/src/ui/gui/psppire-dict.c +++ b/src/ui/gui/psppire-dict.c @@ -19,13 +19,14 @@ #include #include -#include +#include #include "psppire-dict.h" #include #include #include #include +#include #include "helper.h" #include "message-dialog.h" @@ -153,7 +154,7 @@ psppire_dict_class_init (PsppireDictClass *class) G_SIGNAL_RUN_FIRST, 0, NULL, NULL, - marshaller_VOID__INT_INT_INT, + psppire_marshal_VOID__INT_INT_INT, G_TYPE_NONE, 3, G_TYPE_INT, @@ -315,7 +316,7 @@ psppire_dict_init (PsppireDict *psppire_dict) PsppireDict* psppire_dict_new_from_dict (struct dictionary *d) { - PsppireDict *new_dict = g_object_new (G_TYPE_PSPPIRE_DICT, NULL); + PsppireDict *new_dict = g_object_new (PSPPIRE_TYPE_DICT, NULL); new_dict->dict = d; dict_set_callbacks (new_dict->dict, &gui_callbacks, new_dict); @@ -434,7 +435,9 @@ psppire_dict_set_name (PsppireDict* d, gint idx, const gchar *name) -/* Return the IDXth variable */ +/* Return the IDXth variable. + Will return NULL if IDX exceeds the number of variables in the dictionary. + */ struct variable * psppire_dict_get_variable (const PsppireDict *d, gint idx) { @@ -750,10 +753,11 @@ tree_model_get_value (GtkTreeModel *model, GtkTreeIter *iter, { case DICT_TVM_COL_NAME: { - gchar *name = pspp_locale_to_utf8(var_get_name (var), -1, NULL); - g_value_init (value, G_TYPE_STRING); - g_value_set_string (value, name); - g_free (name); + gchar *name = recode_string (UTF8, psppire_dict_encoding (dict), + var_get_name (var), -1); + g_value_init (value, G_TYPE_STRING); + g_value_set_string (value, name); + g_free (name); } break; case DICT_TVM_COL_VAR: @@ -857,3 +861,12 @@ psppire_dict_dump (const PsppireDict *dict) } } #endif + + + + +const gchar * +psppire_dict_encoding (const PsppireDict *dict) +{ + return NULL; +}