Mercurial > mplayer.hg
changeset 35872:93ab56bda68a
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.
author | ib |
---|---|
date | Fri, 15 Mar 2013 03:46:53 +0000 |
parents | 8f49b68dd955 |
children | 65f7b2fdda46 |
files | gui/app/cfg-old.c gui/dialog/playlist.c |
diffstat | 2 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/app/cfg-old.c Fri Mar 15 03:42:57 2013 +0000 +++ b/gui/app/cfg-old.c Fri Mar 15 03:46:53 2013 +0000 @@ -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 @@ return name; } - +#endif return fname; } + +#undef CFG_OLD_PLAYLIST
--- a/gui/dialog/playlist.c Fri Mar 15 03:42:57 2013 +0000 +++ b/gui/dialog/playlist.c Fri Mar 15 03:46:53 2013 +0000 @@ -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 @@ 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 ) );