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

Modified Files:
        charset.c file.c prefs.c prefs_window.c 
Log Message:

Finish up charset fixes.


Index: charset.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/charset.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- charset.c   25 Jun 2006 04:16:52 -0000      1.27
+++ charset.c   25 Jun 2006 05:56:39 -0000      1.28
@@ -154,7 +154,7 @@
     static GList *charsets = NULL; /* list with choices -- takes a while to
                                     * initialize, so we only do it once */
     
-    current_charset = prefs_get_charset ();
+    current_charset = prefs_get_string("charset");
     if ((current_charset == NULL) || (strlen (current_charset) == 0))
     {
        description = g_strdup (_("System Charset"));
@@ -206,6 +206,7 @@
     /* set standard entry */
     gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (combo)->entry), description);
     g_free (description);
+    g_free(current_charset);
 }
 
 

Index: file.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/file.c,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -d -r1.179 -r1.180
--- file.c      24 Jun 2006 15:39:22 -0000      1.179
+++ file.c      25 Jun 2006 05:56:39 -0000      1.180
@@ -717,7 +717,7 @@
 /* update the track->charset info with the currently used charset */
 void update_charset_info (Track *track)
 {
-    const gchar *charset = prefs_get_charset ();
+    const gchar *charset = prefs_get_string("charset");
     ExtraTrackData *etr;
 
     g_return_if_fail (track);
@@ -1510,12 +1510,9 @@
 
     if (!prefs_get_int("update_charset") && charset_set)
     {   /* we should use the initial charset for the update */
-       if (prefs_get_charset ())
-       {   /* remember the charset originally set */
-           prefs_charset = g_strdup (prefs_get_charset ());
-       }
+       prefs_charset = prefs_get_string("charset");
        /* use the charset used when first importing the track */
-       prefs_set_charset (etr->charset);
+       prefs_set_string("charset", etr->charset);
     }
 
     trackpath = get_file_name_from_source (track, SOURCE_PREFER_LOCAL);
@@ -1614,10 +1611,11 @@
 
     if (!prefs_get_int("update_charset") && charset_set)
     {   /* reset charset */
-       prefs_set_charset (prefs_charset);
+       prefs_set_string("charset", prefs_charset);
     }
 
     g_free (trackpath);
+    g_free(prefs_charset);
 
     while (widgets_blocked && gtk_events_pending ())  gtk_main_iteration ();
 }
@@ -1899,12 +1897,9 @@
     else               track_charset_set = FALSE;
     if (!prefs_get_int("write_charset") && track_charset_set)
     {   /* we should use the initial charset for the update */
-       if (prefs_get_charset ())
-       {   /* remember the charset originally set */
-           prefs_charset = g_strdup (prefs_get_charset ());
-       }
+       prefs_charset = prefs_get_string("charset");
        /* use the charset used when first importing the track */
-       prefs_set_charset (etr->charset);
+       prefs_set_string("charset", etr->charset);
     }
     else
     {   /* we should update the track->charset information */
@@ -1947,7 +1942,7 @@
 
     if (!prefs_get_int("write_charset") && track_charset_set)
     {   /* reset charset */
-       prefs_set_charset (prefs_charset);
+       prefs_set_string("charset", prefs_charset);
     }
     g_free (prefs_charset);
     return TRUE;

Index: prefs.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/prefs.c,v
retrieving revision 1.263
retrieving revision 1.264
diff -u -d -r1.263 -r1.264
--- prefs.c     25 Jun 2006 04:16:52 -0000      1.263
+++ prefs.c     25 Jun 2006 05:56:41 -0000      1.264
@@ -1949,10 +1949,6 @@
                  prefs_set_string (EXPORT_FILES_TPL, arg);
              }
          }
-         else if(g_ascii_strcasecmp (line, "charset") == 0)
-         {
-               if(strlen (arg))      prefs_set_charset(arg);
-         }
          else if(g_ascii_strcasecmp (line, "id3_all") == 0)
          {
              /* obsoleted since 0.71 */
@@ -2227,25 +2223,6 @@
     return cfg->md5tracks;
 }
 
-void prefs_set_charset (gchar *charset)
-{
-    prefs_cfg_set_charset (cfg, charset);
-}
-
-void prefs_cfg_set_charset (struct cfg *cfgd, gchar *charset)
-{
-    C_FREE (cfgd->charset);
-    if (charset && strlen (charset))
-       cfgd->charset = g_strdup (charset);
-/*     printf ("set_charset: '%s'\n", charset);         */
-}
-
-gchar *prefs_get_charset (void)
-{
-    return cfg->charset;
-/*     printf ("get_charset: '%s'\n", cfg->charset); */
-}
-
 struct cfg *clone_prefs(void)
 {
     struct cfg *result = NULL;

Index: prefs_window.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/prefs_window.c,v
retrieving revision 1.178
retrieving revision 1.179
diff -u -d -r1.178 -r1.179
--- prefs_window.c      23 Jun 2006 16:03:06 -0000      1.178
+++ prefs_window.c      25 Jun 2006 05:56:42 -0000      1.179
@@ -689,24 +689,18 @@
       st_show_visible();
    }
   
-   if (tmpcfg)
-    {
-       /* Need this in case user reordered column order (we don't
-        * catch the reorder signal) */
-       tm_store_col_order ();
-       prefs_set_charset(tmpcfg->charset);
+   /* Need this in case user reordered column order (we don't
+    * catch the reorder signal) */
+   tm_store_col_order ();
 
-       /* this call well automatically destroy/setup the md5 hash table */
-       prefs_set_md5tracks(tmpcfg->md5tracks);
-       tm_show_preferred_columns();
-       st_show_visible();
-       display_show_hide_tooltips();
-       display_show_hide_toolbar();
-       
-    }
+   /* this call well automatically destroy/setup the md5 hash table */
+   prefs_set_md5tracks(tmpcfg->md5tracks);
+   tm_show_preferred_columns();
+   st_show_visible();
+   display_show_hide_tooltips();
+   display_show_hide_toolbar();
 }
 
-
 /* save current window size */
 void prefs_window_update_default_sizes (void)
 {
@@ -1107,7 +1101,7 @@
 
     descr = gtk_editable_get_chars (editable, 0, -1);
     charset = charset_from_description (descr);
-    prefs_cfg_set_charset (tmpcfg, charset);
+    temp_prefs_set_string(temp_prefs, "charset", charset);
     g_free (descr);
     g_free (charset);
 }


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to