Revision: 1546
http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1546&view=rev
Author: jcsjcs
Date: 2007-06-13 07:44:42 -0700 (Wed, 13 Jun 2007)
Log Message:
-----------
* src/prefs.c (read_prefs_get_key_value): don't strip
whitespace from prefs values. This is none of this
function's business! (Thanks to Todd for tracking this down)
* src/display_sorttabs.c (st_create_notebook): set up compare
function so that the ignore strings work right after startup.
(Thanks to Todd for tracking this down)
Modified Paths:
--------------
gtkpod/trunk/ChangeLog_detailed
gtkpod/trunk/src/display_sorttabs.c
gtkpod/trunk/src/prefs.c
Modified: gtkpod/trunk/ChangeLog_detailed
===================================================================
--- gtkpod/trunk/ChangeLog_detailed 2007-06-11 13:57:42 UTC (rev 1545)
+++ gtkpod/trunk/ChangeLog_detailed 2007-06-13 14:44:42 UTC (rev 1546)
@@ -1,3 +1,13 @@
+2007-06-13 Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+ * src/prefs.c (read_prefs_get_key_value): don't strip
+ whitespace from prefs values. This is none of this
+ function's business! (Thanks to Todd for tracking this down)
+
+ * src/display_sorttabs.c (st_create_notebook): set up compare
+ function so that the ignore strings work right after startup.
+ (Thanks to Todd for tracking this down)
+
2007-06-08 Todd Zullinger <tmzullinger at users.sourceforge.net>
* gtkpod.glade
Modified: gtkpod/trunk/src/display_sorttabs.c
===================================================================
--- gtkpod/trunk/src/display_sorttabs.c 2007-06-11 13:57:42 UTC (rev 1545)
+++ gtkpod/trunk/src/display_sorttabs.c 2007-06-13 14:44:42 UTC (rev 1546)
@@ -261,6 +261,20 @@
}
+/* set string compare function according to whether the ignore field
+ is set or not */
+static void st_set_string_compare_func (guint inst, guint page_num)
+{
+ gchar *buf;
+ buf = g_strdup_printf ("sort_ign_field_%d", ST_to_T (page_num));
+ if (prefs_get_int (buf))
+ sorttab[inst]->string_compare_func = compare_string_fuzzy;
+ else
+ sorttab[inst]->string_compare_func = compare_string;
+ g_free (buf);
+}
+
+
/* callback */
static void
on_st_switch_page (GtkNotebook *notebook,
@@ -268,7 +282,6 @@
guint page_num,
gpointer user_data)
{
- gchar *buf;
guint inst = GPOINTER_TO_UINT( user_data );
@@ -277,12 +290,7 @@
/* set compare function for strings (to speed up sorting) */
if (page_num != ST_CAT_SPECIAL)
{
- buf = g_strdup_printf ("sort_ign_field_%d", ST_to_T (page_num));
- if (prefs_get_int (buf))
- sorttab[inst]->string_compare_func = compare_string_fuzzy;
- else
- sorttab[inst]->string_compare_func = compare_string;
- g_free (buf);
+ st_set_string_compare_func (inst, page_num);
}
space_data_update ();
st_page_selected (notebook, page_num);
@@ -3062,6 +3070,8 @@
page = prefs_get_int_index("st_category", inst);
st->current_category = page;
gtk_notebook_set_current_page (st->notebook, page);
+ st_set_string_compare_func (inst, page);
+
if (prefs_get_int("st_sort") != SORT_NONE)
st_sort_inst (inst, prefs_get_int("st_sort"));
@@ -3082,7 +3092,6 @@
for (inst=SORT_TAB_MAX-1; inst>=0; --inst)
{
sorttab[inst] = g_malloc0 (sizeof (SortTab));
- sorttab[inst]->string_compare_func = compare_string;
st_create_notebook (inst);
}
/* adjust number of visible sorttabs (cannot use st_show_visible()
Modified: gtkpod/trunk/src/prefs.c
===================================================================
--- gtkpod/trunk/src/prefs.c 2007-06-11 13:57:42 UTC (rev 1545)
+++ gtkpod/trunk/src/prefs.c 2007-06-13 14:44:42 UTC (rev 1546)
@@ -602,8 +602,8 @@
if ((len > 0) && ((*value)[len - 1] == 0x0a))
(*value)[len - 1] = 0;
- /* Strip whitespace */
- g_strstrip (*value);
+ /* Don't strip whitespace! If there is any, there's a reason for it. */
+ /* g_strstrip (*value); */
return TRUE;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2