After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 423766 - Saving mail attachments doesn't work properly in 2.10
Saving mail attachments doesn't work properly in 2.10
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
2.10.x (obsolete)
Other Linux
: Normal major
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2007-03-28 14:58 UTC by Matthew Barnes
Modified: 2007-04-19 19:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (7.12 KB, patch)
2007-04-14 16:10 UTC, Matthew Barnes
committed Details | Review
Proposed patch for gnome-2-18 (601 bytes, patch)
2007-04-18 11:21 UTC, Matthew Barnes
committed Details | Review

Description Matthew Barnes 2007-03-28 14:58:30 UTC
Forwarding from a downstream bug report:
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=234315

I have an email message (in an Exchange folder, although I don't know if that
makes a difference) with an attachment called zones.tar.  I click "Save" and it
pops up a dialog.  In the "Location" field, I enter "/tmp/zones.tar" and hit
Enter.  Instead of creating the file /tmp/zones.tar, it creates an empty
directory called /tmp/zones.tar and doesn't save the attachment.

Next, I try simply popping up the save dialog and clicking the "Save" button,
which presumably should save the file in my home directory since that's what's
selected in the Places list if I don't change anything.  It does in fact save
the file in my home directory, but the dialog remains popped up instead of
dismissing.

I'm using evolution-2.10.0-2.fc7.
Comment 1 Matthew Barnes 2007-03-28 14:59:16 UTC
I'm confirming this.  It's a regression from Evolution 2.8.
Comment 2 Matthew Barnes 2007-04-14 15:59:01 UTC
The first paragraph actually describes two bugs.  Whether saving one or many attachments, Evolution asks the user to select a folder.  This is confusing behavior, as shown by what the reporter expected to happen.  When saving one attachment, the GtkFileChooser should be in SAVE mode, not SELECT_FOLDER mode.

The second bug was introduced by bug #349966.  When saving multiple attachments, Evolution is using gtk_file_chooser_get_current_folder_uri() to get the URI of the user-selected folder.  But that functions returns the currently DISPLAYED folder, not the currently SELECTED folder.  So when the reporter typed "tmp/zones.tar" (which is actually a folder path), Evolution correctly created the user-selected folder but saved the attachment into the displayed folder (which I'm guessing was his home directory).

I've not been able to reproduce the behavior described in the second paragraph.  The reporter claims that the attachment was corrected saved in his home directory, but I suspect the file may have already been there as a side-effect of the first attempt.
Comment 3 Matthew Barnes 2007-04-14 16:10:16 UTC
Created attachment 86342 [details] [review]
Proposed patch

Patch for the reproducible parts of this bug.  In the course of debugging this I also refactored em_utils_save_part() and em_utils_save_parts(), fixing a few subtle bugs along the way.
Comment 4 Srinivasa Ragavan 2007-04-18 10:05:37 UTC
Some Alignment issues
+        GtkWidget *file_chooser;

Looks fine other wise. Please commit to HEAD only. It has a new string  _("Save attachment as")
Comment 5 Matthew Barnes 2007-04-18 11:15:00 UTC
Patch committed to Subversion trunk (revision 33429).
Comment 6 Matthew Barnes 2007-04-18 11:21:09 UTC
Created attachment 86560 [details] [review]
Proposed patch for gnome-2-18

Here's a more conservative patch for the stable gnome-2-18 branch.  It replaces gtk_file_chooser_get_current_folder_uri() with gtk_file_chooser_get_uri() when using a GtkFileChooser in SELECT_FOLDER mode.
Comment 7 Srinivasa Ragavan 2007-04-19 17:49:45 UTC
Please commit.
Comment 8 Matthew Barnes 2007-04-19 19:51:11 UTC
Committed to the gnome-2-18 branch (revision 33433).