Add unit tests.
* src/engine/imap/transport/imap-deserializer.vala (Deserialiser): Add a
new EOL even handler to the FAILED state that is the one place where
the deserialize_failure() signal is fired and that any existing params
are reset.
(Deserialiser::push_line): Remove signal calls and unused return
value. Don't use EOS to detect NUL to avoid some confusion. Ensure an
EOL event is always fired so that the FAILED EOF handler is always run.
(Deserialiser::push_data): Remove signal calls and unused return value.
(Deserialiser::flush_params): Don't bother returning a state, since we
now always know what the next one should be when calling it. Only
trigger the parameters_ready() signal if there is a valid
parameter. Make logging consistent with the rest of the class.
(Deserialiser::reset_params): New common method for resetting any
existing deserialised message.
(Deserialiser::on_literal_char): Minor tidy up.
(Deserialiser::on_eos): Ensure that any existing param is sent on EOS
so that any BYE+EOS sent by the server is picked up.
Fixes Bug 781488.
* src/engine/imap/transport/imap-deserializer.vala (Deserializer): Update
char handling in START_PARAM state to be more explict and to handle all
possible chars, not just a subset. Then, simply defer to START_PARAM to
determine what to do when an invalid atom char is encountered when in
the ATOM state. Rename SYSTEM_FLAG state to just FLAG since it also
handles extension flags, and only use it for handling the first char in
the flag so "\*" can be treated appropriately, then defer to the ATOM
state, so flag keywords are treated in the same way as regular
atoms. Add unit tests.
* src/engine/imap/transport/imap-deserializer.vala: Remove unused object
attr, reorder signals based on priority, make is_halted() public so
test cases can call it, put public methods up the top.
* test/testcase.vala (TestCase): Make the test case's main loop
accessible to subclasses so they are using the same one we are.
(TestCase::async_result): Use GLib main context rather than GTK+ main
loop so that test cases with async methods work even when GTK+ not
present.
(TestCase::async_complete): Ensure the main loop is woken when an async
test completes so the test case doesn't block if it loses the race with
async_result();
We can't just simply run xgettext twice (once as normal, once with just
the contractor file and passing "--desktop" as an arg, since
l10n.gnome.org won't pick up the second pass and the contract will remain
untranslated.
So work around by renaming the contractor file such that it is
recognised, then rename it back to normal when translating it.
* desktop/geary-attach.contract.in: Renamed to
desktop/geary-attach.contract.desktop.in.
* desktop/CMakeLists.txt: Undo the rename when translating.
* po/CMakeLists.txt, po/Makevars: Add a xgettext keyword for the
contractor Description field.
* po/POTFILES.in: Chase the file rename.
* Ported Gtk.Action to GLib.Action in the GearyController.
* Removed Gtk.AccelGroups (handled through Gtk.Application now).
* Got rid of Gtk.UiManager (now all is done through Gtk.Builder).
* Throw away workaround for conflicting Gtk.Actions in ComposerContainer.
* Aggregate zoom in/out/normal into one parameterized zoom action.
Signed-off-by: Niels De Graef <nielsdegraef@gmail.com>
* src/engine/util/util-html.vala (smart_escape): Don't bother attempting
to match a pair of tags, just something that looks like an opening tag,
since IMG is an empty element and it is valid to not have a closing
slash in HTML. Also, closing tags in HTML are optional anwyay. Add some
unit tests.
Fixes Bug 784300.
* src/client/application/secret-mediator.vala (SecretMediator): Add
check_unlocked() method, call that up front from the public mediate API
methods.
This gives us access to the full libsecret API.
* bindings/vapi/libsecret-1.vapi: Deleted.
* src/client/application/secret-mediator.vala (Object): Use an internal
binding to the missing SCHEMA_COMPAT_NETWORK constant.
Add unit tests.
* src/engine/imap/transport/imap-deserializer.vala (Deserialiser): Add a
new EOL even handler to the FAILED state that is the one place where
the deserialize_failure() signal is fired and that any existing params
are reset.
(Deserialiser::push_line): Remove signal calls and unused return
value. Don't use EOS to detect NUL to avoid some confusion. Ensure an
EOL event is always fired so that the FAILED EOF handler is always run.
(Deserialiser::push_data): Remove signal calls and unused return value.
(Deserialiser::flush_params): Don't bother returning a state, since we
now always know what the next one should be when calling it. Only
trigger the parameters_ready() signal if there is a valid
parameter. Make logging consistent with the rest of the class.
(Deserialiser::reset_params): New common method for resetting any
existing deserialised message.
(Deserialiser::on_literal_char): Minor tidy up.
(Deserialiser::on_eos): Ensure that any existing param is sent on EOS
so that any BYE+EOS sent by the server is picked up.
Fixes Bug 781488.
* src/engine/imap/transport/imap-deserializer.vala (Deserializer): Update
char handling in START_PARAM state to be more explict and to handle all
possible chars, not just a subset. Then, simply defer to START_PARAM to
determine what to do when an invalid atom char is encountered when in
the ATOM state. Rename SYSTEM_FLAG state to just FLAG since it also
handles extension flags, and only use it for handling the first char in
the flag so "\*" can be treated appropriately, then defer to the ATOM
state, so flag keywords are treated in the same way as regular
atoms. Add unit tests.
* src/engine/imap/transport/imap-deserializer.vala: Remove unused object
attr, reorder signals based on priority, make is_halted() public so
test cases can call it, put public methods up the top.
* test/testcase.vala (TestCase): Make the test case's main loop
accessible to subclasses so they are using the same one we are.
(TestCase::async_result): Use GLib main context rather than GTK+ main
loop so that test cases with async methods work even when GTK+ not
present.
(TestCase::async_complete): Ensure the main loop is woken when an async
test completes so the test case doesn't block if it loses the race with
async_result();
We can't just simply run xgettext twice (once as normal, once with just
the contractor file and passing "--desktop" as an arg, since
l10n.gnome.org won't pick up the second pass and the contract will remain
untranslated.
So work around by renaming the contractor file such that it is
recognised, then rename it back to normal when translating it.
* desktop/geary-attach.contract.in: Renamed to
desktop/geary-attach.contract.desktop.in.
* desktop/CMakeLists.txt: Undo the rename when translating.
* po/CMakeLists.txt, po/Makevars: Add a xgettext keyword for the
contractor Description field.
* po/POTFILES.in: Chase the file rename.
* Ported Gtk.Action to GLib.Action in the GearyController.
* Removed Gtk.AccelGroups (handled through Gtk.Application now).
* Got rid of Gtk.UiManager (now all is done through Gtk.Builder).
* Throw away workaround for conflicting Gtk.Actions in ComposerContainer.
* Aggregate zoom in/out/normal into one parameterized zoom action.
Signed-off-by: Niels De Graef <nielsdegraef@gmail.com>
* src/engine/util/util-html.vala (smart_escape): Don't bother attempting
to match a pair of tags, just something that looks like an opening tag,
since IMG is an empty element and it is valid to not have a closing
slash in HTML. Also, closing tags in HTML are optional anwyay. Add some
unit tests.
Fixes Bug 784300.
* src/client/application/secret-mediator.vala (SecretMediator): Add
check_unlocked() method, call that up front from the public mediate API
methods.
This gives us access to the full libsecret API.
* bindings/vapi/libsecret-1.vapi: Deleted.
* src/client/application/secret-mediator.vala (Object): Use an internal
binding to the missing SCHEMA_COMPAT_NETWORK constant.
* src/engine/imap-db/outbox/smtp-outbox-folder.vala
(Geary.SmtpOutboxFolder.do_postman_async): Flag sent messages rather
than skipping them, only try sending messages that are unsent, always
try saving all messages, re-queue if unsent or unsaved.
* src/engine/imap/api/imap-account.vala
(Geary.Imap.Account.create_folder_async): Ensure that
this.hierarchy_delimiter has been initialized before using it.
This implements new cache for ContactListStore.
ContactListStore is created only once per account when account is opened
with GearyController::open_account. It is destroyed in
GearyController::close_account.
ContactListStoreCache class is introduced to manage ContactListStore
instances.
ComposerWidget receives ContactListStoreCache instance instead of
ContactListStore directly in constructor.
To increase performance, backwards compatibility breaking changes are
introduced to Engine API Geary.ContactStore. Signals:
* Gee.ContactStore::contact_added(Contact)
* Gee.ContactStore::contact_updated(Contact)
are replaced with batch equivalents:
* Gee::ContactStore::contacts_added(Gee.Collection<Contact>)
* Gee::ContactStore::contacts_updated(Gee.Collection<Contact>)
Geary.ComposerWidget::load_entry_completions is no longer async as it does
not involve time consuming ContactListStore creation.
CONTACT_MARKUP_NAME column is removed from ContactListStore as it used to keep
state about highlighted areas of text. This is not possible anymore as
ContactListStore is shared between multiple ComposerWidgets.
Highlight implementation has been moved to Geary.ContactEntryCompletion instead.
Additionally contacts_loaded signal is emitted from Geary.ImapEngine.GenericAccount
and propagated to Geary.Account
Geary.ContactListStore sort function is set upon receiving contacts_loaded
signal instead of after initial contacts are loaded. This speeds up Geary
startup for users with long contact lists.