This attempts to solve bug
[#714921](https://bugzilla.gnome.org/show_bug.cgi?id=714921).
They are available as two buttons on the format bar, next to font
options. The icons I used are taken from a free icons site just for demo
purposes and should be replaced by new icons. Also I did not include
hotkeys mainly because I could not come up with a good one, also they
are pretty uncommon I think.
Also added new icons to icons/CMakeLists.txt
* desktop/meson.build: Make sure the schema is re-compiled with the
source XML changes.
* meson.build: Make compiling the schema mandatory, since both running
the client locally and unit tests require it. Fix path to compiled
schema so the client can find it.
Since libmessaging-menu has a either a broken pkg_config file or a dumb
VAPI name, we need to detect the library and the VAPI in two steps, then
add them both as dependencies.
Some remarks:
* Note that Meson adds a hard dependency on Python 3.
* All dependencies and defines are now listed together.
* Some build files were put in their respective subdirectories, e.g. the Geary
engine library will be built from the Meson file in `src/engine`.
* `--fatal-warnings` is no longer an explicit flag, as Meson provides
`-Dwerror=true` for this.
* An explicit resource file needs to be used. The issue to support this from
Meson itself can be found at https://github.com/mesonbuild/meson/issues/706 .
* The `gnome.yelp()` function parses a LINGUAS file so we no longer need to keep
track of all languages in our build system.
* There are no Debian scripts defined in the meson.build files to keep them
clean, but they can be kept as separate scripts in `build-aux`.
* Left out the `dist` target as there is now `ninja dist`
* `geary-docs` is disabled by default, as valadoc-0.38.3 returns errors.
https://bugzilla.gnome.org/show_bug.cgi?id=777044
* src/client/conversation-viewer/conversation-message.vala
(ConversationMessage.load_avatar): We are very occasionally getting
crashes calling Gtk.Image.get_pixel_size() due to the image is null -
maybe a race? This obviates the problem by hard-coding the size instead
of dynamically getting it.
This ensures that only a single request for a resource is made at once,
to work around crashes in SoupCache when multiple requests for the same
resource.
Hopefully fixes Bug 778720 once and for all.
* src/client/conversation-viewer/conversation-list-box.vala
(ConversationListBox): Add new AvatarStore class and internal
AvatarLoader class to manage avatar loads for the
conversation. Construct an instance of the store in the
constructor and pass it to ConversationEmail::start_loading so its
messages can use it for loading their sender avatars. Update call
sites.
* src/client/conversation-viewer/conversation-message.vala
(ConversationMessage::load_avatar): Add AvatarLoader param for loading
avatars, use that rather than making the Soup calls directly. Update
call sites.
* src/engine/imap-engine/imap-engine-email-prefetcher.vala
(EmailPrefetcher): Connect to email_locally_{appended,inserted} rather
than email_{appended,inserted}.
* src/engine/imap-engine/replay-ops/imap-engine-list-email-by-id.vala
(AbstractListEmail): Throw an error if asking for a specific message,
asking for it to be included in the results, but the message not
actually appearing in the results.
Previously when appending new messages to a local folder we were ignoring
messages in the same folder with the same internal date and RFC822
size. This changes the ImapDB::Folder's behaviour in this case to use the
same message object but re-associate it with the folder, meaning on
re-sync, we don't find a hole in the message sequence again and go
searching for it over and over.
* src/engine/imap-db/imap-db-folder.vala
(Folder::do_search_for_duplicates): Break out UID check to simplify
call semantics and fast-path finding obvious duplicates. Look for
duplicate messages, but simply return them and let caller determine
policy.
(Folder::do_create_or_merge_email): Do UID duplicate check up front
before searching for dupe messages, if duplicate message is found,
append to the folder anyway and merge. Rework to be explicit about
param prerequisites up front and throw and error rather than asserting
if not met. Unify common calls in both create and merge cases.
* src/engine/imap-engine/imap-engine-account-synchronizer.vala
(AccountSynchronizer::sync_folder_async): For the last-ditch sync,
ensure we list newest-to-oldest and for int.MAX count to make sure the
folder is fully expanded.
* src/engine/imap-engine/replay-ops/imap-engine-abstract-list-email.vala
(AbstractListEmail): Update doc comments,
(AbstractListEmail::expand_vector_async): Document, re-work to simplify
the implementation and make it a bit more obvious how and why the lower
and higher bounds are calculated, and make sure they conform to the API
docs and use by existing call sites.
* src/engine/imap/api/imap-folder.vala (Account::uid_to_position_async):
Make caller's life easier by throwing an error if the results from the
server are obviously bogus and never return null.
* src/engine/imap-engine/imap-engine-account-synchronizer.vala
(AccountSynchronizer::process_folder_async): Since the folder might
not have opened yet, the counts may be wrong, so don't rely on them.
* src/engine/imap-engine/imap-engine-account-synchronizer.vala
(AccountSynchronizer): Log periodic aspects of the account synchroniser
as PERIODIC.
* src/engine/imap-engine/imap-engine-minimal-folder.vala
(MinimalFolder::find_earliest_email_async): Remove two debug calls that
were getting triggered for every sync pass. These should be in the
synchroniser instead.
* src/engine/imap-engine/imap-engine-generic-account.vala
(GenericAccount): When closing, wait for each folder to close before
shutting down the local and remote connections.
* src/client/application/geary-controller.vala
(GearyController::close_async): Close both inboxes and accounts in
parallel. Don't wait for conversation monitor or inboxes to close
before closing the account now that the accound does so. The account
needs to start closing so that the background synchroniser stops, and
that needs to stop before any open folder will close. Otherwise if the
background synchroniser is currently synchronising an inbox or any open
folder, then the account will not close until the synchroniser
finishes, which could block for a long time.
* src/engine/api/geary-abstract-local-folder.vala (Folder),
src/engine/imap-engine/imap-engine-minimal-folder.vala (MinimalFolder):
Notify the close semaphore in the classes' ctors so that if they are
never opened, calling wait_for_close_async() does not block.
* src/engine/imap-engine/imap-engine-account-synchronizer.vala
(AccountSynchronizer): Don't try to disconnect from account signals in
dtor, the instance may already be gone.
* src/engine/imap/api/imap-account.vala (Account): Replace camel case
methods names with underscores per style guide, fix sense of
is_no_select test in fetch_folder_cached_async() to account for the
double nagative, and clean up the resulting if/else clause a bit.
Thanks to Torben for bug report and inital patch.
* src/engine/imap/transport/imap-client-session.vala
(ImapClientSession::get_delimiter_for_path): If the folder root does
not exist as a namespace, look for an empty namespace, then default to
the personal namespace.