# HG changeset patch # User masneyb # Date 1177631254 0 # Node ID 936635b76f0288dc93cae00bdfc83a67f6e09633 # Parent ecac0834d141fb8c85b068da26924a2ccd2e3f2f 2007-4-26 Brian Masney * src/gtk/misc-gtk.c lib/gftp.h lib/protocols.c - added filename_utf8_encoded flag to the gftp_file structure. If this is false, then don't attempt to show the filename in the GTK port. The user can still select the blank filename though. diff -r ecac0834d141 -r 936635b76f02 ChangeLog --- a/ChangeLog Wed Apr 25 22:23:16 2007 +0000 +++ b/ChangeLog Thu Apr 26 23:47:34 2007 +0000 @@ -1,3 +1,9 @@ +2007-4-26 Brian Masney + * src/gtk/misc-gtk.c lib/gftp.h lib/protocols.c - added + filename_utf8_encoded flag to the gftp_file structure. If this is false, + then don't attempt to show the filename in the GTK port. The user can + still select the blank filename though. + 2007-4-18 Brian Masney * src/gtk/gftp-gtk.c src/gtk/gtkui.c src/gtk/gftp-gtk.h - added new function gftp_gtk_init_request(). It will initialize a gftp_request diff -r ecac0834d141 -r 936635b76f02 lib/gftp.h --- a/lib/gftp.h Wed Apr 25 22:23:16 2007 +0000 +++ b/lib/gftp.h Thu Apr 26 23:47:34 2007 +0000 @@ -257,8 +257,11 @@ done_rm : 1, /* Remove the file when done */ transfer_done : 1, /* Is current file transfer done? */ retry_transfer : 1, /* Is current file transfer done? */ - exists_other_side; /* The file exists on the other side during - the file transfer */ + exists_other_side : 1, /* The file exists on the other side + during the file transfer */ + filename_utf8_encoded : 1; /* Is the filename properly UTF8 + encoded? */ + char transfer_action; /* See the GFTP_TRANS_ACTION_* vars above */ /*@null@*/ void *user_data; }; diff -r ecac0834d141 -r 936635b76f02 lib/protocols.c --- a/lib/protocols.c Wed Apr 25 22:23:16 2007 +0000 +++ b/lib/protocols.c Thu Apr 26 23:47:34 2007 +0000 @@ -703,12 +703,17 @@ if (ret >= 0 && fle->file != NULL) { - utf8 = gftp_filename_to_utf8 (request, fle->file, &destlen); - if (utf8 != NULL) + if (g_utf8_validate (fle->file, -1, NULL)) + fle->filename_utf8_encoded = 1; + else { - tmpfile = fle->file; - fle->file = utf8; - g_free (tmpfile); + utf8 = gftp_filename_to_utf8 (request, fle->file, &destlen); + if (utf8 != NULL) + { + g_free (fle->file); + fle->file = utf8; + fle->filename_utf8_encoded = 1; + } } } diff -r ecac0834d141 -r 936635b76f02 src/gtk/misc-gtk.c --- a/src/gtk/misc-gtk.c Wed Apr 25 22:23:16 2007 +0000 +++ b/src/gtk/misc-gtk.c Thu Apr 26 23:47:34 2007 +0000 @@ -747,7 +747,7 @@ gtk_clist_set_pixmap (GTK_CLIST (wdata->listbox), clist_num, 0, pix, bitmap); - if (fle->file != NULL) + if (fle->file != NULL && fle->filename_utf8_encoded) gtk_clist_set_text (GTK_CLIST (wdata->listbox), clist_num, 1, fle->file); if (GFTP_IS_SPECIAL_DEVICE (fle->st_mode))