Since MailboxParameter inherited from StringParameter directly, it meant
that we could never send mailbox names as quoted strings. Also, the
modified-UTF-7 encoding used for mailbox names does not encode
atom-specials such as "\", so if a mailbox name contained one or more of
these, it would be sent to the mail server unquoted.
This removes the MailboxParameter class altogether, and does the
parameter conversion to/from appropriate StringParameter subclasses as
needed. Also adds unit tests for param conversion for ASCII,
atom-specials, and non-ASCII mailbox names.
Fixes issue #40
ConfigFile is a GLib.KeyFile-like class (and is backed by a KeyFile) that
nonetheless provides convenient a high-level API for getting and setting
grouped config values and asynchronous loading and saving.
* src/engine/util/util-config-file.vala: New ConfigFile class.
* src/engine/api/geary-service-information.vala (ServiceInformation):
Require ConfigFile groups rather than KeyFile instances for loading and
saving. Update subclasses and unit tests.
* src/client/accounts/account-manager.vala (AccountManager): Move generic
account key consts here from Config. Instead of using KeyFile directly,
use ConfigFile groups for loading and saving settings. Rename load and
save methods to be a bit more consistent with the class's role, and
make save_account() throw its errors so they can be reported to the
user. Update call sites.
* src/client/accounts/local-service-information.vala
(LocalServiceInformation): Move service-specific config key consts
here, use new ConfigFile groups for loading and saving.
* src/engine/api/geary-config.vala: Removed, all config consts have been
moved to the classes using them and KeyFile convenience methods
subsumed by ConfigFile.
This introduces the Geary.RFC822.Part class, which provides a place to
MIME entity body decoding code so it can be reused when needed. It also
provides a place to put common GMime to Geary object conversion, and
apply some common policy decisions, such as what is the default content
type if none is specified.
* src/engine/rfc822/rfc822-part.vala: New Part class that represents a
MIME entity. Move code for both decoding entity body from
RFC822.Message and code for cleaning content filename from RFC822.Util
to here. Convert GMime entity header objects into their Geary
equivalents and make available as properties. Provide a common means of
determining the content type of the part if not explicitly set.
* src/engine/rfc822/rfc822-message-data.vala (PreviewText.with_header):
Construct a RFC822.Part and use that for decoding preview text. Swap
args to make some more sense and update call sites.
* src/engine/rfc822/rfc822-message.vala (InlinePartReplacer): Simply pass
through an instance of a RFC822.Part rather than the multi-arg list,
since that has all the data needed by replacers.
* src/engine/imap-db/imap-db-attachment.vala (Attachment): Require and
use RFC822.Part instances for obtaining attachment bodies rather than
GMime.Part instances. Update call sites.