Reverting commit 1d8c4aea broke the mailbox class a bit. This fixes the
issue, introduces Ascii.last_index_of which is needed by Mailbox anyway,
and adds some test for it. Also 'optimises' Ascii.index_of bit as well.
Fixes Bug 778027.
* src/client/conversation-viewer/conversation-viewer.vala
(ConversationViewer): Disable disable kinetic scrolling before showing
an embedded composer so that if it still has some momentum when the
composer is inserted and scrolled to, it won't jump away again.
* src/engine/imap/command/imap-create-command.vala (Command): Rename
atom consts so they do not collide with GObject property names defines
generated by older version of valac.
* src/client/composer/composer-widget.vala (ComposerWidget): When
removing an attachment, check for existing pending attachments
afterwards but don't add them, just enable the button instead.
* ui/composer-widget.ui: Make the info label esliipsisable, but give it a
reasonable minimum size.
* src/client/composer/composer-widget.vala (ComposerWidget): Set the info
label's tooltip with the text so it can still be read when ellipsed.
* src/client/composer/composer-widget.vala (Composer): Replace use of
inappropriate public properties and obtuse property bindings with a
subject_changed signal and private properties that update the info
label in their setter, so it's obvious how the whole thing works. Move
code for managing a detached compoer's window title to the
ComposerWindow class.
This also ensure that if the user causes the from account quickly, that
there isn't any undesirable interleaving of drafts managers as multiple
instances are possibly opened and closed.
Fixes 778976.
* src/client/composer/composer-widget.vala (ComposerWidget): When
reopening the draft manager and one exists already, discard its draft
first. When opening a new draft manager, use a cancellable to stop any
existing draft manager being opened, and to close any being opened when
the widget is destroyed. Use a private var when opening/closing the
draft managers so the class field is only updated when the instance has
fully opened and as soon as it starts to be closed.
Fixes Bug 793710.
* src/client/composer/composer-headerbar.vala (ComposerHeaderbar): Ensure
we actually get notified when the user changes their decoration prefs
and update detach button location correctly.
* ui/composer-headerbar.ui: Make start detach button's image visible by
default.
* src/client/conversation-viewer/conversation-email.vala
(MessageViewIterator): Fix class to actually obey Gee.Iterator and
Gee.Traversable.foreach contracts, so the first attached message has
its body loaded when the email is loaded.
Follow-up to Bug 776881 and commit e333794f, fixes Bug 794264.
* src/client/application/geary-application.vala,
src/client/composer/composer-container.vala: Use
GLib.get_monotonic_time() instead of get_real_time() when calling
Gtk.Window.present_with_time to avoid issues with mutter/gnome-shell
alt-tabbing.
It looks like Gtk.Spinner triggers repaints when running, even when the
widget is not visible. This ensures the conversation is stopped when not
visible.
Fix for Bug 783025.
* src/client/conversation-viewer/conversation-viewer.vala
(ConversationViewer): Start the conversation spinner when showing it,
stop the conversation spinner when it is hidden.
* src/engine/app/app-conversation-monitor.vala (ConversationMonitor):
Don't check the folder blacklist for external folder signals when the
signal is received, do it when the operation is executed so it's fresh.
* src/engine/app/conversation-monitor/app-fill-window-operation.vala
(FillWindowOperation): Only re-fill the conversation if we get a full
load, anything else means we hit the end of the folder.
* test/engine/app/app-conversation-monitor-test.vala: New unit tests
for ConversationMonitor.
* test/engine/api/geary-account-mock.vala,
test/engine/api/geary-folder-mock.vala: Mix in MockObject mock up all
method calls.
* test/engine/api/geary-email-identifier-mock.vala: Fix the comparator
method when the other instance is null.
This replaces the use of Geary.Folder.find_boundaries_async in
ConversationMonitor with a simple sorted set of known in-folder message
ids. This is both easy and fast, reduces needless DB load when loading
conversations, and also allows allows removing what is otherwise
single-use implementation overhead in classes deriving from Folder.
* src/engine/app/app-conversation-monitor.vala (ConversationMonitor):
Replace get_lowest_email_id_async() with window_lowest property, update
call sites. Implement the property by using a sorted set of known
listed email ids from the base folder. Update the set as messages in
the base folder are listed. Rename notify_emails_removed to just
removed and remove ids from the set if any messages from the base
folder are removed.
* src/engine/api/geary-folder.vala (Folder): Remove
get_lowest_email_id_async since it is now unused, do same for all
subclasses.
* test/api/*.vala: Renamed files that contained mock objects to *-mock.vala,
not *-test.vala.
* test/testcase.vala: Renamed to test-case.vala for consistency, remove
TestCase class from Gee package since that's really not true. Clean up
code for consistency.
* test/meson.build, test/CMakeLists.txt: Split TestCase compilation out
into a separate test lib.