geary/test/engine
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
..
api Clean up default filename when saving attachments. 2017-02-16 08:44:27 +11:00
mime-content-type-test.vala Add ContentType.is_default and unit test. 2017-02-15 17:50:49 +11:00
rfc822-mailbox-address-test.vala Add an initial/example unit test. 2016-12-13 11:27:19 +11:00
rfc822-message-data-test.vala Make to_preview_text() require UNIX (LF), not RFC833 (CRLF) strings. 2016-12-21 10:45:21 +11:00
rfc822-message-test.vala Add unit test for Geary.RFC822.Message::get_preview. 2016-12-23 10:38:23 +10:30
rfc822-utils-test.vala Make to_preview_text() require UNIX (LF), not RFC833 (CRLF) strings. 2016-12-21 10:45:21 +11:00
util-html-test.vala Add test case handling HTML entities when converting to text. 2016-12-20 12:27:07 +11:00
util-idle-manager-test.vala Add IdleManager class for sane main loop idle scheduling. 2017-02-09 10:54:45 +11:00
util-inet-test.vala Add Geary.Inet::is_valid_display_host and tests. 2017-02-01 00:41:44 +11:00
util-js-test.vala Fix brown-paper-bag bug in Geary.JS::escape_string. 2017-02-01 00:41:45 +11:00
util-timeout-manager-test.vala Implement milliseconds ctor and tests for Geary.TimeoutManager. 2017-02-01 00:41:44 +11:00