Markup generation requires lots of resources to walk through lists,
build strings, compare strings, etc. And all of this gets done on every
draw of conversation-list widget for every conversation. Let's save up
some resources by caching the markup.
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Fetching the value and comparing it to 0 should work just as fast as
directly assigning it. And since we don't really need to know here what
was the value of is_unread before, remove the comparison.
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
The first comment now mentions that entries are unique. This can be
exploited in further commits.
Second comment is misleading: the "if not present, add" part is clear
from code below, and the "in chronological order" is the misleading one:
chronological order is ensured by the first foreach, not by the second
foreach where the comment placed. And the first foreach already has a
commentary about the order.
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Notification mails, such as github, gitlab, often gonna have the same
mail address, although participants are different. Fix the comparator to
take this situation into account.
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Use string.get_next_char() to handle iterating over an
RFC822.MailboxAddress mailbox local part, and explicitly allow UTF-8
2, 3, and 4 byte chars without quoting, per RFC 5322.
This lets us fix the test cases that use UTF-8 chars in the local part.
Since the primary application instance could be invoked by a number of
actions (activate, about, compose, etc), ensure that a controller has
been constructed by the time the action is invoked, and ensure that
only one controller can be constructed at any one time.
Since Applicaton.Controller constructs a MainWindow instance when it
is constructed, but the MainWindow and some other related classes
accesses the controller via the deprecated GearyApplication singleton
when they are cunstructed, the controller instance is still null and
a critical is reported instead.
Most of the code in question was related to classes needing to
know when the controller's account/folder/conversation monitor has
changed, so invert the call chain and have the controller let these
classes know.
The main culprit was the current conversation monitor, but since that
is very MainWindow-specific, just move it to the main window from the
controller, so the controller only needs to let the main window know
that the selected folder has changed.
When mails weren't loaded from database, conversation list may happen to
load mails through load_full_email function, which expands mails by
default.
Ideally this function shouldn't be called for these mails, but correct
solution would require to store conversation in database, for now lets
work around it by simply checking whether a mail needs to be expanded.
Fixes https://gitlab.gnome.org/GNOME/geary/issues/396
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Convert the controller's open_async() method into its constructor, make
previously nullable properties not nullable, make the application's
instance null until it is contructed, rename to match dir convention.
Move GTK code from create_async into startup. Remove `_async` suffix
from method names. Make methods not used externally private & move
private methods to the bottom of the source tree. Don't check for the
controller being null since it can't be. Update some doc comments.
Previously our search entry for conversations was too small
for the placeholder text, and looked awkward in comparison
to the entry for searching messages.
Now we set them to have the same width-chars.
Fixes https://gitlab.gnome.org/GNOME/geary/issues/390
Previously we used a separator in the middle of the main toolbar and extended the width of the HeaderBar in order to
special case for Ambiance.
Ambiance is no longer the default Ubuntu theme, and sticking
with GNOME design patterns should be prioritized over
special casing with a theme.
Fixes https://gitlab.gnome.org/GNOME/geary/issues/389