Fixes problem introduced by commit 157a109e.
* src/client/application/secret-mediator.vala (SecretMediator): Recreate
SCHEMA_COMPAT_NETWORK schema object locally since using a CCcodr attr
doesn't seem to work.
* src/engine/imap-engine/imap-engine-generic-account.vala
(Account::update_folders_async): Don't fall over creating special use
folders if only one fails.
* src/engine/imap/response/imap-mailbox-attributes.vala
(MailboxAttributes::get_special_folder_type): Remove duplicate clause.
The IMAP CREATE-SPECIAL-USE extension allows specifying the use of a
mailbox being created. We should use it if present.
* src/engine/imap/api/imap-account.vala (Account::create_folder_async):
Add optional SpecialFolderType param, if present use command variant
that accepts it.
* src/engine/imap/command/imap-create-command.vala (Command): Add
additional ctor that accepts a SpecialFolderType param. If present,
add a USE list to the command sent.
* src/engine/imap/response/imap-capabilities.vala (Capabilities): Add
CREATE-SPECIAL-USE to the list of known capabilities, sort the list.
* src/engine/imap/api/imap-account.vala (Account): Add
get_default_personal_namespace() method to return a folder at the root
of the default personal namespace.
* src/engine/imap/transport/imap-client-session.vala (ClientSession):
Make inbox and namespace attrs into RO internal properties so Account
can access them.
* src/engine/imap-engine/imap-engine-generic-account.vala
(Account::ensure_special_folder_async): Get the default namespace
folder and use that when checking for matching folders, rather than
trying to guess just at the root then INBOX. If not found, assume the
folder should be a child of the root.
* src/engine/imap/api/imap-account.vala
(Account:list_child_folders_async): Renamed to
fetch_child_folders_async to match other remote-y methods, make returb
value non-null since nulls suck. Fix call site.
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.
Now that ClientSession is storing per-connection inbox and namespace
data, we want to always consult with the account or folder's session to
determine the correct Imap.MailboxSpecifier name for a high-level
Geary.FolderPath, and vice versa.
This is enforced by removing all inbox and delim information from Imap.Accout
and Imap.Folder, and providing methods to translate between
MailboxSpecifier and FolderPath, then fixing up the fallout.
* src/engine/imap/transport/imap-client-session.vala (ClientSession): Add
methods for obtaining the delimiter and converting between foler paths
and mailbox names, based on information obtainined from the IMAP server
for this connection.
* src/engine/imap/api/imap-account.vala (Account): Remove
path_to_mailbox, inbox_specifier, and hierarchy_delimiter object
attributes since these are connection specific. Convert from caching
all mailbox specifiers retreived from the server and some Imap.Folder
instances to simply cache all Folder instances. Substantially rework
the public API implementation as below to support this and update all
call sites.
(Account::folder_exists_async): Actually hit the server rather than
justing looking at the cache to determine if the folder exists, remove
a folder from the cache if not.
(Account::fetch_folder_async): Renamed from
"fetch_unrecycled_folder_async" so as to be a bit less obtuse, updated
call sites.
(Account::fetch_folder_cached_async): Renamed from fetch_folder_async
to be a bit more obvious. Substantially simplified, deleates to
fetch_folder_async() rather than list_children_async() method, so we
don't need list all children of its parent and hence to do a status for
each. Rather than passing a "created" flag out and forcing call sites
to then do a second call to update message counts, just simply take a
boolean param indicating if we should do it here.
(Account::list_child_folders_async): Simplified a bit, updated to
create and cache an Imap.Folder for each child.
(Account::fetch_counts_async): Removed and merged into
fetch_folder_cached_async() since the only call site was replaced by
the new refresh_counts param on that method.
(Account::send_list_async, send_status_async): renamed from
list_children_async and fetch_status_async, to make it obvious about
what they are actually doing. Added an instance of ClientSession as
first param so they don't have to re-claim the same session.
(Account::send_command_async, send_multiple_async): Also add an
instance of ClientSession as first param so they don't have to re-claim
a session after the public methods calling them have already done so.
* src/engine/imap/api/imap-folder.vala (Folder): As for Imap.Account,
remove mailbox info delim (these were redundant anyway) and replace
uses on the folder's client session for converting between folder paths
and mailbox names.
* src/engine/api/geary-folder-path.vala (FolderPath): Remove
get_fullpath(), since having it would only encourage API users to do
the wrong thing.
* src/engine/imap/message/imap-mailbox-specifier.vala
(MailboxSpecifier::from_folder_path): Ensure the inbox name is also
passed in and manually construct a mailbox name from a FolderPath so
the connection's actual inbox name ca be substituted in.
Since each IMAP connection may have different notions of namespaces and
mailbox hierarchy delimiters, inbox names, and so on, store this
information per-connection rather than per-account.
Don't remove uses of old inbox and delimiters yet, that will be next.
* src/engine/imap/api/imap-account.vala (Account): Remove list_inbox()
and its single call site.
* src/engine/imap/transport/imap-client-session.vala (ClientSession): Add
class attributes for storing namespace prefix and mailbox hierarchy
delimiter information for the inbox and RFC 2342 namespaces. Add a
namespace signal, fire it when a namespace server response is reached.
(ClientSession::initiate_session_async): After logging in and enabling
compression, obtain the mailbox info for the inbox and either namespace
information if supported, or else attempt to guess what the default user
mailbox is.
* 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.
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();