projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Disable drag and drop on sheet axes for which there is no connected signal
[pspp]
/
src
/
ui
/
gui
/
psppire-encoding-selector.c
diff --git
a/src/ui/gui/psppire-encoding-selector.c
b/src/ui/gui/psppire-encoding-selector.c
index 42fbea44e6c4cfe78a878346397ea79a08efd25d..73cac2209561f09bbe77f976a8e7b0b986c36df1 100644
(file)
--- a/
src/ui/gui/psppire-encoding-selector.c
+++ b/
src/ui/gui/psppire-encoding-selector.c
@@
-173,7
+173,7
@@
psppire_encoding_selector_new (const char *default_encoding,
renderer, set_sensitive,
NULL, NULL);
renderer, set_sensitive,
NULL, NULL);
- hbox = gtk_
hbox_new (FALSE
, 0);
+ hbox = gtk_
box_new (GTK_ORIENTATION_HORIZONTAL
, 0);
gtk_box_pack_start (GTK_BOX (hbox),
gtk_label_new (_("Character Encoding: ")),
FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox),
gtk_label_new (_("Character Encoding: ")),
FALSE, FALSE, 0);
@@
-183,13
+183,17
@@
psppire_encoding_selector_new (const char *default_encoding,
return hbox;
}
return hbox;
}
+/*
+ Return a string describing the currently selected encoding.
+ The caller should free this string when no longer required.
+*/
gchar *
psppire_encoding_selector_get_encoding (GtkWidget *selector)
{
gchar *encoding = NULL;
gchar *
psppire_encoding_selector_get_encoding (GtkWidget *selector)
{
gchar *encoding = NULL;
- GList *list, *pos;
+ GList *pos;
+ GList *list = gtk_container_get_children (GTK_CONTAINER (selector));
- list = gtk_container_get_children (GTK_CONTAINER (selector));
for (pos = list; pos; pos = pos->next)
{
GtkWidget *widget = pos->data;
for (pos = list; pos; pos = pos->next)
{
GtkWidget *widget = pos->data;
@@
-206,7
+210,14
@@
psppire_encoding_selector_get_encoding (GtkWidget *selector)
break;
}
}
break;
}
}
+
g_list_free (list);
g_list_free (list);
- return encoding && !strcmp (encoding, "Auto") ? NULL : encoding;
+ if (0 == strcmp (encoding, "Auto"))
+ {
+ g_free (encoding);
+ return NULL;
+ }
+
+ return encoding;
}
}