geary/test
Michael James Gratton 2a7fca9397 Clean up default filename when saving attachments.
This ensures both inline images are saved using the specified content
filename, if any, and that an extension is attempted to be guessed when
no filename is specified.

Fixes Bug 713999, Bug 712923, Bug 778026.

* src/client/application/geary-controller.vala: Major rework of how
  attachments are saved. Rework how save dialogs are constructed,
  combining common code paths into one constrcutor method. Split up code
  for saving one attachment vs many into two different methods. Ensure
  all code baths ultimately use the same method to do the actual
  saving. Lookup a attachment when saving an inline image and use that
  by default. Get filenames from new Attachment::get_useful_filename
  method that guesses if needed.

* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage::save_image): Fix name of first param to reflect
  what it actually is.

* src/engine/api/geary-attachment.vala (Attachment): Add
  ::get_safe_filename method that checks the type of both the
  attachment's content and its file name, if any. Will construct an
  appropriate file name if non is given. Add unit tests.

* src/engine/api/geary-email.vala (Email): Add new
  ::get_attachment_by_content_id to lookup attachments by MIME
  content-id. Rename old ::get_attachment method to disambiguate.
2017-02-16 08:44:27 +11:00
..
client Don't insert multiple blank lines in the composer. Bug 778125. 2017-02-07 12:09:29 +11:00
engine Clean up default filename when saving attachments. 2017-02-16 08:44:27 +11:00
js Don't insert multiple blank lines in the composer. Bug 778125. 2017-02-07 12:09:29 +11:00
CMakeLists.txt Clean up default filename when saving attachments. 2017-02-16 08:44:27 +11:00
main.vala Clean up default filename when saving attachments. 2017-02-16 08:44:27 +11:00
testcase.vala Update some test code attributions. 2017-02-01 00:41:45 +11:00