[MPlayer-cvslog] r35966 - in trunk/gui: app/cfg-old.c dialog/playlist.c

ib subversion at mplayerhq.hu
Fri Mar 15 04:46:53 CET 2013


Author: ib
Date: Fri Mar 15 04:46:53 2013
New Revision: 35966

Log:
Utilize new cfg_old_filename_from_utf8() in playlist code.

Use it instead of g_filename_from_utf8(), because the content of the
history file will change from UTF-8 encoded filenames to filenames in
their original byte sequence.

Modified:
   trunk/gui/app/cfg-old.c
   trunk/gui/dialog/playlist.c

Modified: trunk/gui/app/cfg-old.c
==============================================================================
--- trunk/gui/app/cfg-old.c	Fri Mar 15 04:42:57 2013	(r35965)
+++ trunk/gui/app/cfg-old.c	Fri Mar 15 04:46:53 2013	(r35966)
@@ -31,6 +31,7 @@
  */
 static const gchar *cfg_old_filename_from_utf8(const gchar *fname)
 {
+#ifdef CFG_OLD_PLAYLIST
     static gchar *name;
 
     if (g_utf8_validate(fname, -1, NULL)) {
@@ -39,6 +40,8 @@ static const gchar *cfg_old_filename_fro
 
         return name;
     }
-
+#endif
     return fname;
 }
+
+#undef CFG_OLD_PLAYLIST

Modified: trunk/gui/dialog/playlist.c
==============================================================================
--- trunk/gui/dialog/playlist.c	Fri Mar 15 04:42:57 2013	(r35965)
+++ trunk/gui/dialog/playlist.c	Fri Mar 15 04:46:53 2013	(r35966)
@@ -43,6 +43,9 @@
 #include "pixmaps/open2.xpm"
 #include "pixmaps/dir2.xpm"
 
+#define CFG_OLD_PLAYLIST 1
+#include "gui/app/cfg-old.c"
+
        GtkWidget * PlayList = NULL;
 static GtkWidget * CTDirTree;
 static GtkWidget * CLFiles;
@@ -546,7 +549,7 @@ GtkWidget * create_PlayList( void )
   gtk_ctree_expand( GTK_CTREE( CTDirTree ),parent );
   gtk_widget_show( CTDirTree );
 
-  if ( fsHistory[0] ) old_path = g_filename_from_utf8( fsHistory[0], -1, NULL, NULL, NULL );
+  if ( fsHistory[0] ) old_path = strdup( cfg_old_filename_from_utf8( fsHistory[0] ) );
 
   gtk_clist_set_column_widget( GTK_CLIST( CTDirTree ),0,
     AddLabel( MSGTR_PLAYLIST_DirectoryTree,NULL ) );


More information about the MPlayer-cvslog mailing list