aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@src.gnome.org>2007-08-20 15:11:31 +0800
committerMilan Crha <mcrha@src.gnome.org>2007-08-20 15:11:31 +0800
commite3bc9c823718c769c9667b9f707fdabf0d8f0697 (patch)
treec3ba81a3e0baaf7f04563033d26c7fafe4d114b4
parent37f9a781d6ef656ddfca1359ee524a4c3fa9b531 (diff)
downloadgsoc2013-evolution-e3bc9c823718c769c9667b9f707fdabf0d8f0697.tar.gz
gsoc2013-evolution-e3bc9c823718c769c9667b9f707fdabf0d8f0697.tar.zst
gsoc2013-evolution-e3bc9c823718c769c9667b9f707fdabf0d8f0697.zip
2007-08-20 mcrha Fix for bug #367760
svn path=/trunk/; revision=34042
-rw-r--r--e-util/ChangeLog7
-rw-r--r--e-util/e-dialog-utils.c15
-rw-r--r--mail/ChangeLog9
-rw-r--r--mail/em-utils.c14
4 files changed, 29 insertions, 16 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index 47239435fb..5d95f05d2f 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,10 @@
+2007-08-20 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #367760
+
+ * e-dialog-utils.c: (e_file_get_save_filesel):
+ Don't escape characters of file name, suppose it has been already done.
+
2007-08-18 Tobias Mueller <muelli@auftrags-killer.org>
patch by: Tim Yamin <plasm@roo.me.uk>
diff --git a/e-util/e-dialog-utils.c b/e-util/e-dialog-utils.c
index a65f946ace..b6626aed37 100644
--- a/e-util/e-dialog-utils.c
+++ b/e-util/e-dialog-utils.c
@@ -350,7 +350,7 @@ e_file_dialog_save_folder (const char *title)
* e_file_get_save_filesel:
* @parent: parent window
* @title: dialog title
- * @name: filename
+ * @name: filename; already in a proper form (suitable for file system)
* @action: action for dialog
*
* Creates a save dialog, using the saved directory from gconf. The dialog has
@@ -360,7 +360,7 @@ GtkWidget *
e_file_get_save_filesel (GtkWidget *parent, const char *title, const char *name, GtkFileChooserAction action)
{
GtkWidget *filesel;
- char *realname, *uri;
+ char *uri;
filesel = gtk_file_chooser_dialog_new (title,
NULL,
@@ -376,18 +376,11 @@ e_file_get_save_filesel (GtkWidget *parent, const char *title, const char *name,
uri = e_file_get_save_path();
- if (name && name[0]) {
- realname = gnome_vfs_escape_string (name);
- } else {
- realname = NULL;
- }
-
gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (filesel), uri);
- if (realname)
- gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (filesel), realname);
+ if (name && name[0])
+ gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (filesel), name);
- g_free (realname);
g_free (uri);
return filesel;
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 62e070be6b..308e2688e5 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,12 @@
+2007-08-20 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #367760
+
+ * em-utils.c: (em_filename_make_safe): Added '#' as non-safe character.
+ * em-utils.c: (em_utils_save_part): Using em_filename_make_safe and
+ creates filename similar to em_utils_save_parts.
+ * em-utils.c: (em_utils_save_parts): Using em_filename_make_safe.
+
2007-08-20 Johnny Jacob <jjohnny@novell.com>
** Fix for bug #467599.
diff --git a/mail/em-utils.c b/mail/em-utils.c
index adf0f839ce..6a9762f02b 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -328,9 +328,9 @@ em_filename_make_safe (gchar *string)
gchar *p, *ts;
gunichar c;
#ifdef G_OS_WIN32
- const char *unsafe_chars = "/\":*?<>|\\";
+ const char *unsafe_chars = "/\":*?<>|\\#";
#else
- const char *unsafe_chars = "/";
+ const char *unsafe_chars = "/#";
#endif
g_return_if_fail (string != NULL);
@@ -385,10 +385,12 @@ void
em_utils_save_part (GtkWidget *parent, const char *prompt, CamelMimePart *part)
{
GtkWidget *file_chooser;
- const gchar *filename;
- gchar *uri = NULL;
+ const gchar *utf8_filename;
+ gchar *uri = NULL, *filename;
- filename = emu_save_get_filename_for_part (part);
+ utf8_filename = emu_save_get_filename_for_part (part);
+ filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL);
+ em_filename_make_safe (filename);
file_chooser = e_file_get_save_filesel (
parent, prompt, filename, GTK_FILE_CHOOSER_ACTION_SAVE);
@@ -413,6 +415,7 @@ em_utils_save_part (GtkWidget *parent, const char *prompt, CamelMimePart *part)
exit:
gtk_widget_destroy (file_chooser);
g_free (uri);
+ g_free (filename);
}
void
@@ -439,6 +442,7 @@ em_utils_save_parts (GtkWidget *parent, const gchar *prompt, GSList *parts)
utf8_filename = emu_save_get_filename_for_part (part);
filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL);
+ em_filename_make_safe (filename);
uri = g_build_path ("/", path_uri, filename, NULL);
g_free (filename);