Update of /cvsroot/gtkpod/gtkpod/src
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv806/src

Modified Files:
        display_sorttabs.c prefs.c prefs.h 
Log Message:

Move sp_playcount_low/high to new prefs.


Index: display_sorttabs.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display_sorttabs.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- display_sorttabs.c  5 Jun 2006 02:57:39 -0000       1.72
+++ display_sorttabs.c  5 Jun 2006 06:41:47 -0000       1.73
@@ -495,11 +495,11 @@
     /* PLAYCOUNT */
     if (prefs_get_int_index("sp_playcount_cond", inst))
     {
-       guint32 low = prefs_get_sp_playcount_low (inst);
+       guint32 low = prefs_get_int_index("sp_playcount_low", inst);
        /* "-1" will translate into about 4 billion because I use
           guint32 instead of gint32. Since 4 billion means "no upper
           limit" the logic works fine */
-       guint32 high = prefs_get_sp_playcount_high (inst);
+       guint32 high = prefs_get_int_index("sp_playcount_high", inst);
        checked = TRUE;
        if ((low <= track->playcount) && (track->playcount <= high))
            cond = TRUE;
@@ -960,7 +960,7 @@
 {
     guint32 inst = (guint32)GPOINTER_TO_UINT(user_data) & SP_MASK;
 
-    prefs_set_sp_playcount_low (inst,
+    prefs_set_int_index("sp_playcount_low", inst,
                                gtk_spin_button_get_value (spinbutton));
     if (prefs_get_int_index("sp_playcount_cond", inst))
        sp_conditions_changed (inst);
@@ -973,7 +973,7 @@
 {
     guint32 inst = (guint32)GPOINTER_TO_UINT(user_data) & SP_MASK;
 
-    prefs_set_sp_playcount_high (inst,
+    prefs_set_int_index("sp_playcount_high", inst,
                                 gtk_spin_button_get_value (spinbutton));
     if (prefs_get_int_index("sp_playcount_cond", inst))
        sp_conditions_changed (inst);
@@ -2800,14 +2800,14 @@
                        G_CALLBACK (on_sp_playcount_low_value_changed),
                        GINT_TO_POINTER(inst));
       gtk_spin_button_set_value (GTK_SPIN_BUTTON (w),
-                                prefs_get_sp_playcount_low (inst));
+                                prefs_get_int_index("sp_playcount_low", inst));
       w = gtkpod_xml_get_widget (special_xml, "sp_playcount_high");
       g_signal_connect ((gpointer)w,
                        "value_changed",
                        G_CALLBACK (on_sp_playcount_high_value_changed),
                        GINT_TO_POINTER(inst));
       gtk_spin_button_set_value (GTK_SPIN_BUTTON (w),
-                                prefs_get_sp_playcount_high (inst));
+                                prefs_get_int_index("sp_playcount_high", 
inst));
 
       /* PLAYED */
       buf = prefs_get_string_index("sp_played_state", inst);

Index: prefs.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/prefs.c,v
retrieving revision 1.197
retrieving revision 1.198
diff -u -d -r1.197 -r1.198
--- prefs.c     5 Jun 2006 02:57:39 -0000       1.197
+++ prefs.c     5 Jun 2006 06:41:47 -0000       1.198
@@ -165,6 +165,8 @@
       prefs_set_string_index("sp_played_state", i, ">4w");
       prefs_set_string_index("sp_modified_state", i, "<1d");
       prefs_set_string_index("sp_added_state", i, "<1d");
+      prefs_set_int_index("sp_playcount_low", i, 0);
+      prefs_set_int_index("sp_playcount_high", i, -1);
     }
 }
 
@@ -1659,8 +1661,6 @@
     mycfg->autoimport = FALSE;
     for (i=0; i<SORT_TAB_MAX; ++i)
     {
-       mycfg->st[i].sp_playcount_low = 0;
-       mycfg->st[i].sp_playcount_high = -1;
        mycfg->st[i].sp_autodisplay = FALSE;
     }
     mycfg->mpl_autoselect = TRUE;
@@ -1906,16 +1906,6 @@
          {
              prefs_set_autoimport((gboolean)atoi(arg));
          }
-         else if(arg_comp (line, "sp_playcount_low", &off) == 0)
-         {
-             gint i = atoi (line+off);
-             prefs_set_sp_playcount_low (i, atoi (arg));
-         }
-         else if(arg_comp (line, "sp_playcount_high", &off) == 0)
-         {
-             gint i = atoi (line+off);
-             prefs_set_sp_playcount_high (i, atoi (arg));
-         }
          else if(arg_comp (line, "sp_autodisplay", &off) == 0)
          {
              gint i = atoi (line+off);
@@ -2397,8 +2387,6 @@
     fprintf(fp, _("# sort tab: select 'All', last selected page 
(=category)\n"));
     for (i=0; i<SORT_TAB_MAX; ++i)
     {
-       fprintf(fp, "sp_playcount_low%d=%d\n", i, prefs_get_sp_playcount_low 
(i));
-       fprintf(fp, "sp_playcount_high%d=%d\n", i, prefs_get_sp_playcount_high 
(i));
        fprintf(fp, "sp_autodisplay%d=%d\n", i, prefs_get_sp_autodisplay (i));
     }
     fprintf(fp, _("# autoselect master playlist?\n"));
@@ -3349,44 +3337,6 @@
     return FALSE;
 }
 
-
-gint32 prefs_get_sp_playcount_low (guint32 inst)
-{
-    if (inst < SORT_TAB_MAX)
-       return cfg->st[inst].sp_playcount_low;
-    else
-       fprintf (stderr, "prefs_get_sp_playcount_low(): !inst=%d!\n", inst);
-    return 0;
-}
-
-
-gint32 prefs_get_sp_playcount_high (guint32 inst)
-{
-    if (inst < SORT_TAB_MAX)
-       return cfg->st[inst].sp_playcount_high;
-    else
-       fprintf (stderr, "prefs_get_sp_playcount_high(): !inst=%d!\n", inst);
-    return (guint32)-1;
-}
-
-
-void prefs_set_sp_playcount_low (guint32 inst, gint32 limit)
-{
-    if (inst < SORT_TAB_MAX)
-       cfg->st[inst].sp_playcount_low = limit;
-    else
-       fprintf (stderr, "prefs_set_sp_playcount_low(): !inst=%d!\n", inst);
-}
-
-
-void prefs_set_sp_playcount_high (guint32 inst, gint32 limit)
-{
-    if (inst < SORT_TAB_MAX)
-       cfg->st[inst].sp_playcount_high = limit;
-    else
-       fprintf (stderr, "prefs_set_sp_playcount_high(): !inst=%d!\n", inst);
-}
-
 gboolean prefs_get_tmp_disable_sort(void)
 {
     return(cfg->tmp_disable_sort);

Index: prefs.h
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/prefs.h,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -d -r1.124 -r1.125
--- prefs.h     5 Jun 2006 02:57:39 -0000       1.124
+++ prefs.h     5 Jun 2006 06:41:47 -0000       1.125
@@ -106,8 +106,6 @@
   struct
   {
     /* the following fields are for the "special" tab */
-    guint sp_playcount_low;  /* lower limit for playcounts */
-    guint sp_playcount_high; /* higher limit for playcounts */
     gboolean sp_autodisplay; /* display automatically? */
   } st[SORT_TAB_MAX];
   struct sortcfg
@@ -408,10 +406,6 @@
 gboolean prefs_get_info_window (void);
 void prefs_set_sp_autodisplay (guint32 inst, gboolean state);
 gboolean prefs_get_sp_autodisplay (guint32 inst);
-gint32 prefs_get_sp_playcount_low (guint32 inst);
-gint32 prefs_get_sp_playcount_high (guint32 inst);
-void prefs_set_sp_playcount_low (guint32 inst, gint32 limit);
-void prefs_set_sp_playcount_high (guint32 inst, gint32 limit);
 void prefs_set_display_tooltips_main (gboolean state);
 gboolean prefs_get_display_tooltips_main (void);
 void prefs_set_display_tooltips_prefs (gboolean state);



_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to