Commit graph

6556 commits

Author SHA1 Message Date
Michael Gratton
5bb0cb9abb icons: Add icon for beta profile 2021-01-20 20:28:07 +11:00
Michael Gratton
3c4d5c5e9d Geary.RFC822.MailboxAddress: Handle long headers being folded
Remove "\n " sequences from RFC822 text before decoding so that any
long mailboxes/mailbox lists folded before the 80 char limit are
unfolded.

Fixes #1009
2021-01-20 19:24:17 +11:00
Michael Gratton
b51b933b6d Geary.RFC822.Subject: Handle long headers being folded
Remove "\n " sequences from RFC822 text before decoding so that any
long subject lines folded before the 80 char limit are unfolded.

Fixes #895
2021-01-20 19:20:30 +11:00
Yuri Chornoivan
900b51004b Update Ukrainian translation 2021-01-19 15:08:34 +00:00
Michael Gratton
851f13d47f Merge branch 'mjog/upgrade-dialog-cleanup' into 'mainline'
client: Clean up database upgrade dialog implementation

Closes #1007

See merge request GNOME/geary!634
2021-01-19 13:43:02 +00:00
Michael Gratton
c331145fd3 client: Clean up database upgrade dialog implementation
Rename `UpgradeDialog` to `DatabaseManager` since it's not actually a
dialog, move it into the APplication package. Replace old Glade UI file
with a custom built dialog since it's trivial and so we can make it
modal for a main window.

Fixes #1007
2021-01-19 23:50:29 +11:00
Michael Gratton
55081b008c desktop/org.gnome.Geary.appdata.xml.in.in: Mention search in relnotes 2021-01-19 22:02:50 +11:00
Michael Gratton
9af0a2ded2 Merge branch 'mjog/search-update' into 'mainline'
Search implementation update

Closes #838, #814, #756, #474, and #121

See merge request GNOME/geary!616
2021-01-19 10:11:00 +00:00
Michael Gratton
642bf00e88 Util.Email.SearchExpressionFactory: Use ICU for work breaking
Implement search query text word segmentaion using ICU, so that
languages that don't use spaces for word delimiters are correctly
tokenised.
2021-01-19 20:49:01 +11:00
Michael Gratton
2f81fdf146 build: Add minimal ICU VAPI for UBreakIterator 2021-01-19 20:49:01 +11:00
Michael Gratton
58cae0ae40 Geary.ImapDB.Account: Drop post-search stemmed term greedy match removal
Stop post-processing search results by dropping results that contain a
matched term that is longer by some criterion than a stemmed term.

Since this cannot be specified by SQLite's FTS queries, it has to be
done outside of the search, which can have a substantial impact on
performance, and either means running multiple queries outside of a
transaction to get the required number of search results (potentially
a large number of times), running the pruning within a transaction
(potentially blocking the DB for a large length of time), or returning
the wrong number of search results (potentially confusing the caller).

Because of these disadvantages, and since SearchQuery's maximum
difference in lengths between term and stemmed variant helps to prevent
greedy matching anyway, just drop the post processing.
2021-01-19 20:49:01 +11:00
Michael Gratton
24140c07cd Geary.App.RemoveOperation: Queue a window count check after executing
Since when removing messages from the conversation monitor (especially
when a search is changed) the window might get smaller, queue a check
to re-fill if needed.
2021-01-19 20:49:01 +11:00
Michael Gratton
d98467a3f4 Geary.ImapDB.Account: Print SQL for search statements before executing
Helps to debug what the expression generator is doing.
2021-01-19 20:49:01 +11:00
Michael Gratton
d74c024bc9 Geary.FtsSearchQuery: Re-introduce FTS search optimisations
Per commit 9a137699, ensure we tell SQLite what index it should be
using, and are doing the FTS search in a sub-select. Without these,
FTS search is an order of magnitude slower.
2021-01-19 20:49:01 +11:00
Michael Gratton
67af1b2064 po/POFILES.in: Add missing files 2021-01-19 20:49:01 +11:00
Michael Gratton
36ba76b83b src/engine/imap-db/imap-db-fts5-*.c: Fix build warnings 2021-01-19 20:49:01 +11:00
Michael Gratton
7e38198287 ImapDb.Database: Register new ICU-based tokeniser for FTS
The SQLite tokeniser does not deal with scripts that do not use spaces
for word breaking (CJK, Thai, etc), thus searching in those languages
does not work well.

This adds a custom SQLite tokeniser based on ICU that breaks words for
all languages supported by that library, and uses NFKC_Casefold
normalisation to handle normalisation, case folding, and dropping of
ignorable characters.

Fixes #121
2021-01-19 20:48:59 +11:00
Douglas Fuller
90711f234e Geary.App.FillWindowOperation: detect stale FillWindowOperations
When a user types in the search box, there may still be oustanding
FillWindowOperations queued on previous instances of SearchFolder
from previous keystrokes. This can result in a FillWindowOperation
with a stale value of ConversationMonitor.window_lowest from a previous
search executing on the current one. Detect this and return immediately.

Fixes: #838
2021-01-19 20:48:17 +11:00
Michael Gratton
bb02e157c6 Geary.App.SearchFolder: Substantial implementation rework
This does the following:

 * Makes updating the search query a non-async call, so that apps can
   call it and forget about it
 * Makes updating search results only update the folder's contents
   when finished, and not if cancelled
 * Cancels any existing search tasks if the query is updated
 * Swaps sending removed signals before inserted signals to make the
   conversation viewer happier
2021-01-19 20:48:17 +11:00
Michael Gratton
f560707271 Geary.FtsSearchQuery: Fixes for email text disjunctions
Ensure OR is actually used to separate disjuncts, don't prefix match
non-stemmed terms when a stemmed version exists or when EXACT is
specified. Ensure column is correctly specified per disjunct.
2021-01-19 20:48:17 +11:00
Michael Gratton
9bd2359464 Geary.Account: Make new_search_query synchronous
Constructing a new query should be fast, and it no longer needs to be
done async, so remove async from the method and simplify callers.
2021-01-19 20:48:17 +11:00
Michael Gratton
9cb3a0d98c Geary.FtsSearchQuery: Fix build with vala ~ <= 0.48 2021-01-19 20:48:17 +11:00
Michael Gratton
4c911f5be7 Geary.App.SearchFolder: Only update search if query is different
This prevents re-running a search for e.g. whitespace-only changes.
2021-01-19 20:48:17 +11:00
Michael Gratton
092d117c8c Geary.SearchQuery: Enable checking queries and terms for equality
Add `SearchQuery.equal_to` method and virtual `Term.equal_to` method,
overriding it as needed in subclasses.
2021-01-19 20:48:17 +11:00
Michael Gratton
20a4fd3ed2 Geary.ImapDb.SearchQuery: Rename to Geary.FtsSearchQuery
There's nothing IMAP-specific about the class, so move it to common
and rename to reflect what it is actually used for.
2021-01-19 20:48:17 +11:00
Michael Gratton
2ab7b2c39e Geary.ImapDb.SearchQuery: Handle queries with some/all negated terms
SQLite FTS5 doesn't allow all negated terms in matches, and since NOT
is a binary operator (rather than unary) negated terms should be listed
after any positive terms.
2021-01-19 20:48:17 +11:00
Michael Gratton
6ffbfcf5d4 Geary.ImapDb.SearchQuery: Handle folder and deleted message exclusions
Ensure designated excluded folders, folderless messages, and
marked-for-deletion messages are excluded from FTS search results.
2021-01-19 20:48:17 +11:00
Michael Gratton
6a614adf73 Geary.ImapDb.SearchQuery: Use expression to generate FTS5 queries
Move SQL generation for FTS search from ImapDb.Account to SearchQuery.
Convert to use Geary.SearchQuery.Term instances to generate SQL, rather
than parsing the expression. Simplify the generated SQL substantially
and generate MATCH values that work with SQLite FTS5.
2021-01-19 20:48:17 +11:00
Michael Gratton
e0396c322e Geary.ImapDb.SearchQuery: Require stemmer to be passed in to ctor
Since constructing a libstemmer object is non trivial, this allows a
per-account instance to be created just once, and improves testability.
2021-01-19 20:48:17 +11:00
Michael Gratton
0112c8192c Geary.SearchQuery: Allow client apps to build search queries
Adds classes that allow building arbitrary query expressions and require
an instance to be provided to Geary.SearchQuery, to be set as a
property.

This enables query expressions to be parsed by clients instead of the
engine, in which ever whay they choose.
2021-01-19 20:48:17 +11:00
Michael Gratton
4fe0d92147 engine: Convert from SQLite FTS3/4 to FTS5 for full-text-search
Add SQL migration that drops the old FTS4 MessageSearchTable table,
re-create as a FTS5 table, clean up the column names a bit, and adds a
flags column so unread/starred queries can be made fast.

Define a SQLite FTS5 extension function `geary_matches()` to replace
the FTS3 `offsets()` function which no longer exists in FTS5, based on
Tracker's implementation.

Update code to FTS5 conventions (docid -> rowid, etc), use new column
names, populate and update the flags column as the email's flags
change, and use new match function for getting matching tokens.

Advanced searches are probably currently broken, these will be fixed
by subsequent commits.
2021-01-19 20:48:17 +11:00
Michael Gratton
435a5e90f4 Geary.NamedFlag: Add serialise method for non-debug persistence 2021-01-19 20:48:17 +11:00
Michael Gratton
3becbaa538 Update files for 40.alpha release 2021-01-18 22:02:42 +11:00
Michael Gratton
000f602e18 meson.build: Ensure up-to-date main dependencies 2021-01-18 21:57:40 +11:00
Yuri Chornoivan
4973f78486 Update Ukrainian translation 2021-01-18 10:26:06 +00:00
Fabio Tomat
0d3d3006d3 Update Friulian translation 2021-01-18 10:25:13 +00:00
Michael Gratton
cad7aee79d Merge branch 'icon-contrast' into 'mainline'
App icon: improve contrast

See merge request GNOME/geary!632
2021-01-18 10:19:32 +00:00
Michael Gratton
536e7f881d Merge branch 'add-inbox-shortcut' into 'mainline'
application-main-window: Add shortcut to select inbox

Closes #1108

See merge request GNOME/geary!633
2021-01-18 08:58:08 +00:00
Michael Gratton
085b9691a1 ui/gtk/help-overlay.ui 2021-01-18 08:38:03 +00:00
Jeremias Ortega
e0fab92d3c
application-main-window: Add shortcut to select inbox
Closes: https://gitlab.gnome.org/GNOME/geary/-/issues/1108
2021-01-17 16:55:49 -06:00
Tobias Bernard
54a67486ac app icon: darker yellow for better contrast 2021-01-17 11:31:57 +01:00
Мирослав Николић
738aed0da6 Update Serbian translation
(cherry picked from commit 940968424e304b0691ffb4bd51c6497c0249d4e6)
2021-01-17 10:29:34 +00:00
Michael Gratton
5500fe7f72 Merge branch 'mjog/flatpak-webkitgtk-print-workaround' into 'mainline'
org.gnome.Geary.yaml: Workaround for WebKitGTK not printing under Flatpak

See merge request GNOME/geary!631
2021-01-17 09:53:57 +00:00
Michael Gratton
29f6ae63b0 org.gnome.Geary.yaml: Workaround for WebKitGTK not printing under Flatpak
Since WebKitGTK does not currently support printing under Flatpak,
enable RW access to XDG downloads folder, so at least people can print
to a PDF, then print that.

See https://github.com/flathub/org.gnome.Geary/issues/42
2021-01-17 20:19:36 +11:00
Michael Gratton
ec4ced4109 Merge branch 'ricotz/vala' into 'mainline'
Don't alter or try to write [GtkChild] properties

See merge request GNOME/geary!630
2021-01-16 23:23:25 +00:00
Michael Gratton
2fb9d46103 Convert private properties into fields. 2021-01-16 22:58:19 +00:00
Rico Tzschichholz
30105fd4c2 Don't alter or try to write [GtkChild] properties
See https://gitlab.gnome.org/GNOME/vala/issues/1121
2021-01-16 19:16:35 +01:00
Michael Gratton
1ff30d9448 Merge branch 'mjog/db-sql-log-extended' into 'mainline'
Geary.Db.Statement: Log SQL statements with params where possible

See merge request GNOME/geary!629
2021-01-15 23:50:42 +00:00
Michael Gratton
298e4ec2e9 Geary.Db.Statement: Log SQL statements with params where possible
Ensure when SQL logging is enabled, that SQL statements are logged
with parameter values filled in where possible.
2021-01-16 10:07:04 +11:00
Michael Gratton
9cbaaf8f25 Merge branch 'mjog/1118-composer-insert-link' into 'mainline'
Components.WebView: Remove selection_changed signal

Closes #1058 and #1118

See merge request GNOME/geary!627
2021-01-15 13:46:45 +00:00