diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-01-26 03:32:27 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-01-26 03:32:27 +0800 |
commit | 22e539d53689ac5a9efce0cc360987923d54d6ba (patch) | |
tree | 8c261b1e5d0481e9930c21857edff1a55cd59e1f /mail/mail-display.c | |
parent | 91dd1d75d76c31aaab6088482a6a9e5a19777afe (diff) | |
download | gsoc2013-evolution-22e539d53689ac5a9efce0cc360987923d54d6ba.tar.gz gsoc2013-evolution-22e539d53689ac5a9efce0cc360987923d54d6ba.tar.zst gsoc2013-evolution-22e539d53689ac5a9efce0cc360987923d54d6ba.zip |
Save the pathname. (save_part): Use the new mail_config cruft to get the
2002-01-25 Jeffrey Stedfast <fejj@ximian.com>
* mail-display.c (save_data_cb): Save the pathname.
(save_part): Use the new mail_config cruft to get the last used
save pathname.
* mail-config.c (config_read): Read in last_filesel_dir string.
(mail_config_write_on_exit): Save the last_filesel_dir setting.
(mail_config_get_last_filesel_dir): New
(mail_config_set_last_filesel_dir): New
svn path=/trunk/; revision=15474
Diffstat (limited to 'mail/mail-display.c')
-rw-r--r-- | mail/mail-display.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/mail/mail-display.c b/mail/mail-display.c index 15cd27809c..116dba913f 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -71,7 +71,6 @@ struct _PixbufLoader { }; static GHashTable *thumbnail_cache = NULL; -static char *save_pathname = NULL; /* preserves last directory in save dialog */ /*----------------------------------------------------------------------* * Callbacks @@ -154,7 +153,7 @@ save_data_cb (GtkWidget *widget, gpointer user_data) { GtkFileSelection *file_select = (GtkFileSelection *) gtk_widget_get_ancestor (widget, GTK_TYPE_FILE_SELECTION); - char *p; + char *dir; /* uh, this doesn't really feel right, but i dont know what to do better */ gtk_widget_hide (GTK_WIDGET (file_select)); @@ -162,14 +161,9 @@ save_data_cb (GtkWidget *widget, gpointer user_data) FALSE); /* preserve the pathname */ - g_free (save_pathname); - save_pathname = g_strdup (gtk_file_selection_get_filename (file_select)); - if((p = strrchr (save_pathname, '/')) != NULL) - p[0] = 0; - else { - g_free (save_pathname); - save_pathname = NULL; - } + dir = g_dirname (gtk_file_selection_get_filename (file_select)); + mail_config_set_last_filesel_dir (dir); + g_free (dir); gtk_widget_destroy (GTK_WIDGET (file_select)); } @@ -243,10 +237,7 @@ save_part (CamelMimePart *part) g_return_if_fail (part != NULL); camel_object_ref (CAMEL_OBJECT (part)); - if (save_pathname == NULL) - save_pathname = g_strdup (g_get_home_dir ()); - - filename = make_safe_filename (save_pathname, part); + filename = make_safe_filename (mail_config_get_last_filesel_dir (), part); file_select = GTK_FILE_SELECTION ( gtk_file_selection_new (_("Save Attachment"))); |