Commit graph

3290 commits

Author SHA1 Message Date
Niels De Graef
01c13f726f Port build system to Meson. Bug 777044.
Some remarks:

* Note that Meson adds a hard dependency on Python 3.

* All dependencies and defines are now listed together.

* Some build files were put in their respective subdirectories, e.g. the Geary
  engine library will be built from the Meson file in `src/engine`.

* `--fatal-warnings` is no longer an explicit flag, as Meson provides
  `-Dwerror=true` for this.

* An explicit resource file needs to be used. The issue to support this from
  Meson itself can be found at https://github.com/mesonbuild/meson/issues/706 .

* The `gnome.yelp()` function parses a LINGUAS file so we no longer need to keep
  track of all languages in our build system.

* There are no Debian scripts defined in the meson.build files to keep them
  clean, but they can be kept as separate scripts in `build-aux`.

* Left out the `dist` target as there is now `ninja dist`

* `geary-docs` is disabled by default, as valadoc-0.38.3 returns errors.

https://bugzilla.gnome.org/show_bug.cgi?id=777044
2017-12-12 00:27:46 +01:00
Michael James Gratton
b627fd4fc6 Fix another avatar-related critical.
* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage.load_avatar): We are very occasionally getting
  crashes calling Gtk.Image.get_pixel_size() due to the image is null -
  maybe a race? This obviates the problem by hard-coding the size instead
  of dynamically getting it.
2017-12-08 00:00:48 +11:00
Michael James Gratton
b2f0ecab1b Merge branch 'wip/778720-soup-avatar-crash'. Fixes Bug 778720. 2017-12-05 15:06:00 +11:00
Michael James Gratton
923db7c91b Improve ImapDB.Folder debug logging for duplicate search field check. 2017-12-05 15:00:01 +11:00
Michael James Gratton
8afca7fb2e Fix a critical error invoking popup on conversation list.
* src/client/conversation-list/conversation-list-view.vala,
  src/client/conversation-viewer/conversation-message.vala,
  src/client/sidebar/sidebar-tree.vala (TreeView): Use
  Gtk.Menu.popup_at_pointer() rather than deprecated popup() method.

* src/client/util/util-gtk.vala (GtkUtil): Remove unused menu-related
  code.
2017-12-05 14:34:48 +11:00
Michael James Gratton
b6980a2f37 Allow email address with "localhost" as the domain part. Fixes Bug 714299. 2017-12-04 16:42:04 +11:00
Michael James Gratton
bbbded81df Work around ongoing crashes in SoupCache when loading avatars.
This ensures that only a single request for a resource is made at once,
to work around crashes in SoupCache when multiple requests for the same
resource.

Hopefully fixes Bug 778720 once and for all.

* src/client/conversation-viewer/conversation-list-box.vala
  (ConversationListBox): Add new AvatarStore class and internal
  AvatarLoader class to manage avatar loads for the
  conversation. Construct an instance of the store in the
  constructor and pass it to ConversationEmail::start_loading so its
  messages can use it for loading their sender avatars. Update call
  sites.

* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage::load_avatar): Add AvatarLoader param for loading
  avatars, use that rather than making the Soup calls directly. Update
  call sites.
2017-12-04 11:00:25 +11:00
Kukuh Syafaat
735c53085c Update Indonesian translation 2017-12-03 08:41:20 +00:00
Michael James Gratton
9a89d7e037 Fix Flatpak build.
* org.gnome.Geary.json: Add libunwind dep, point libgee back to master
  while we're here.
2017-12-02 22:10:36 +11:00
Michael James Gratton
b1d3d494bc Merge branch 'wip/713530-background-sync'. Fixes Bug 713530. 2017-12-02 12:18:57 +11:00
Michael James Gratton
7c5d89bdb9 Only prefetch messages that have not been seen before.
* src/engine/imap-engine/imap-engine-email-prefetcher.vala
  (EmailPrefetcher): Connect to email_locally_{appended,inserted} rather
  than email_{appended,inserted}.
2017-12-02 01:15:45 +11:00
Michael James Gratton
926aae4ef2 Enforce a an API contract clause for Geary.Folder.list_email_by_id_async.
* src/engine/imap-engine/replay-ops/imap-engine-list-email-by-id.vala
  (AbstractListEmail): Throw an error if asking for a specific message,
  asking for it to be included in the results, but the message not
  actually appearing in the results.
2017-12-02 01:15:45 +11:00
Michael James Gratton
f55cdc33ed Add some debugging so we know when a background sync has completed. 2017-12-02 01:15:45 +11:00
Michael James Gratton
a74dfb5f64 Ensure duplicate messages are still added to local folders.
Previously when appending new messages to a local folder we were ignoring
messages in the same folder with the same internal date and RFC822
size. This changes the ImapDB::Folder's behaviour in this case to use the
same message object but re-associate it with the folder, meaning on
re-sync, we don't find a hole in the message sequence again and go
searching for it over and over.

* src/engine/imap-db/imap-db-folder.vala
  (Folder::do_search_for_duplicates): Break out UID check to simplify
  call semantics and fast-path finding obvious duplicates. Look for
  duplicate messages, but simply return them and let caller determine
  policy.
  (Folder::do_create_or_merge_email): Do UID duplicate check up front
  before searching for dupe messages, if duplicate message is found,
  append to the folder anyway and merge. Rework to be explicit about
  param prerequisites up front and throw and error rather than asserting
  if not met. Unify common calls in both create and merge cases.
2017-12-02 01:15:45 +11:00
Michael James Gratton
8db48f8242 Ensure the account synchroniser actually does some vector expansion.
* src/engine/imap-engine/imap-engine-account-synchronizer.vala
  (AccountSynchronizer::sync_folder_async): For the last-ditch sync,
  ensure we list newest-to-oldest and for int.MAX count to make sure the
  folder is fully expanded.

* src/engine/imap-engine/replay-ops/imap-engine-abstract-list-email.vala
  (AbstractListEmail): Update doc comments,
  (AbstractListEmail::expand_vector_async): Document, re-work to simplify
  the implementation and make it a bit more obvious how and why the lower
  and higher bounds are calculated, and make sure they conform to the API
  docs and use by existing call sites.

* src/engine/imap/api/imap-folder.vala (Account::uid_to_position_async):
  Make caller's life easier by throwing an error if the results from the
  server are obviously bogus and never return null.
2017-12-02 01:15:45 +11:00
Michael James Gratton
6c6737d2ad Replace client call to Gtk.show_uri() with show_uri_on_window().
Former is deprecated, latter works better with Flatpak.

* src/client/application/geary-application.vala: Use show_uri_on_window.
2017-12-02 01:03:51 +11:00
Michael James Gratton
fd91eee46d Add to docs for the IMAP CREATE command. 2017-12-02 00:56:06 +11:00
Michael James Gratton
d66e4526bd Fix some engine build warnings.
* src/engine/imap/command/imap-create-command.vala: Enums can't be null?

* src/engine/rfc822/rfc822-message.vala: Gee.Map has deprecated contains?!
2017-12-02 00:55:33 +11:00
Michael James Gratton
5387bd87ba Don't use local/remote counts to determine if folder should be sync'ed.
* src/engine/imap-engine/imap-engine-account-synchronizer.vala
  (AccountSynchronizer::process_folder_async): Since the folder might
  not have opened yet, the counts may be wrong, so don't rely on them.
2017-12-01 23:01:28 +11:00
Michael James Gratton
4e0b1d8ff3 Update doc comments for Geary.Folder and ::list_email_by_id_async. 2017-12-01 11:42:31 +11:00
Michael James Gratton
f8dc87cb36 Ensure EmailStore always closes folders when executing an operation. 2017-11-28 17:40:15 +11:00
Michael James Gratton
12adbbdcb1 Fix magnitude of connectivity check timeout. 2017-11-24 16:16:58 +11:00
Michael James Gratton
b8304b594b Update unit tests after recent changes. 2017-11-23 09:37:59 +11:00
Michael James Gratton
f42a5d4f12 Fix compile error with vala git master. Fixes Bug 790567.
* src/engine/imap/response/imap-namespace-response.vala
  (NamespaceResponse): Don't try to use arrays as properties. Fix call
  sites.
2017-11-21 10:42:25 +11:00
Michael James Gratton
c1a19dfa80 Make GenericAccount::enumerate_folders_async debug PERIODIC as well. 2017-11-21 10:42:25 +11:00
Michael James Gratton
a24de61242 Turn down default debug logging from the account synchroniser a bit.
* src/engine/imap-engine/imap-engine-account-synchronizer.vala
  (AccountSynchronizer): Log periodic aspects of the account synchroniser
  as PERIODIC.

* src/engine/imap-engine/imap-engine-minimal-folder.vala
  (MinimalFolder::find_earliest_email_async): Remove two debug calls that
  were getting triggered for every sync pass. These should be in the
  synchroniser instead.
2017-11-21 10:42:25 +11:00
Michael James Gratton
7ad941be8e Try harder to ensure Geary always shuts down cleanly.
* src/engine/imap-engine/imap-engine-generic-account.vala
  (GenericAccount): When closing, wait for each folder to close before
  shutting down the local and remote connections.

* src/client/application/geary-controller.vala
  (GearyController::close_async): Close both inboxes and accounts in
  parallel. Don't wait for conversation monitor or inboxes to close
  before closing the account now that the accound does so. The account
  needs to start closing so that the background synchroniser stops, and
  that needs to stop before any open folder will close. Otherwise if the
  background synchroniser is currently synchronising an inbox or any open
  folder, then the account will not close until the synchroniser
  finishes, which could block for a long time.

* src/engine/api/geary-abstract-local-folder.vala (Folder),
  src/engine/imap-engine/imap-engine-minimal-folder.vala (MinimalFolder):
  Notify the close semaphore in the classes' ctors so that if they are
  never opened, calling wait_for_close_async() does not block.
2017-11-21 10:42:25 +11:00
Michael James Gratton
01259104e1 Actually fire Geary.Account::closed signal when closing accounts. 2017-11-21 10:42:25 +11:00
Michael James Gratton
ae5f6a4d31 Document and tweak IMAP keep-alive periods and TCP socket timeouts. 2017-11-21 10:42:25 +11:00
Michael James Gratton
5906b4618f Fix critical warning when deleting an account.
* src/engine/imap-engine/imap-engine-account-synchronizer.vala
  (AccountSynchronizer): Don't try to disconnect from account signals in
  dtor, the instance may already be gone.
2017-11-21 10:42:25 +11:00
Michael James Gratton
69a4e631c1 Minor fix and code cleanup for Geary.Imap.Account.
* src/engine/imap/api/imap-account.vala (Account): Replace camel case
  methods names with underscores per style guide, fix sense of
  is_no_select test in fetch_folder_cached_async() to account for the
  double nagative, and clean up the resulting if/else clause a bit.
2017-11-21 10:42:25 +11:00
Daniel Mustieles
d8d4af7eda Update Spanish translation 2017-11-20 15:50:26 +00:00
Marek Cernocky
e050ecbfd1 Updated Czech translation 2017-11-20 07:55:37 +01:00
Emin Tufan Çetin
14e415bef2 Update Turkish translation 2017-11-20 06:38:53 +00:00
Piotr Drąg
dde4fd2210 Update Polish translation 2017-11-19 20:05:39 +01:00
Michael James Gratton
412549a3f7 Don't try to install the contractor file if disabled. Bug 790382.
Patch courtesy Jiri Cerny.
2017-11-19 21:55:03 +11:00
Michael James Gratton
a46feb24af Fix namespace error listing "[GMail]" mailbox. Bug 790544.
Thanks to Torben for bug report and inital patch.

* src/engine/imap/transport/imap-client-session.vala
  (ImapClientSession::get_delimiter_for_path): If the folder root does
  not exist as a namespace, look for an empty namespace, then default to
  the personal namespace.
2017-11-19 21:49:45 +11:00
Michael James Gratton
d1d8d6411e Merge branch 'wip/713006-better-error-reporting'. Fixes Bug 713006. 2017-11-19 18:35:06 +11:00
Michael James Gratton
8c2a4fc2a5 Add licensing info for libunwind binding, based on convention. 2017-11-19 12:07:14 +11:00
Mario Blättermann
a226d0cebf Update German translation 2017-11-18 20:06:55 +00:00
Frank Brütting
0a52791685 Update German translation 2017-11-18 19:25:34 +00:00
Marek Cernocky
6939894d2e Updated Czech translation 2017-11-18 19:17:35 +01:00
Michael James Gratton
e0ba2716ec Minor code cleanup. 2017-11-18 15:25:51 +11:00
Michael James Gratton
bcca75f5a8 Include a back trace in problem report technical details.
This adds a dependcy on libunwind for generating the back trace.

* src/CMakeLists.txt: Require libunwind-generic package and libunwind
  VAPI. Update docs and debian/control with new dependencies.

* src/engine/api/geary-problem-report.vala (ProblemReport): Generate a
  stack trace in the default constructor if an error is specified.

* src/client/components/main-window-info-bar.vala
  (MainWindowInfoBar::format_details): Include stack trafe from problem
  report in output if present.

* ui/main-window-info-bar.ui: Add a ScrolledWindow around the TextView
  since the details could now be quite large.

* bindings/vapi/libunwind.vapi: Add bindings for libunwind courtesy
  Guillaume Poirier-Morency, add Error enum.
2017-11-18 15:25:28 +11:00
Michael James Gratton
6182f466f5 Delay checking network connectivity if already connected. Bug 776042.
* src/engine/util/util-connectivity-manager.vala: Add both a next-check
  time and a delayed check timer so that if we are already connected and
  a check ran recently, re can avoid running one again for a little while.
2017-11-17 13:18:32 +11:00
Michael James Gratton
1d746e43c7 Fix sketchy line breaking in quoted plain text.
* src/engine/util/util-html.vala (smart_escape): Use "white-space:
  pre-wrap" for preserving whitespace to get decent work breaks.
2017-11-16 18:04:18 +11:00
Michael James Gratton
c2afe8fe48 Fix lost line breaks when selective quoting plain text. Bug 781178.
* src/engine/rfc822/rfc822-utils.vala (quote_body): Smart escape quoted
  part, preserving whitespace if source message is plain text. Throw
  exceptions rather that catching them to clean the code paths up a
  bit. Update call sites.
2017-11-16 18:01:43 +11:00
Michael James Gratton
261e8a4ba3 Prevent composer body/sig/quote parts from losing focus. Bug 779369.
* ui/composer-web-view.js: Add a click handler for the document that
  prevents clicks outside the body parts from being processed.
2017-11-16 15:49:51 +11:00
Michael James Gratton
343bb640e9 Fix composer body text caret not being visible on reply. Bug 788797.
* src/client/composer/composer-widget.vala (ComposerWidget::set_focus):
  Ensure we grab the web view's focus only after its content has finished
  loading.
2017-11-16 12:49:49 +11:00
Michael James Gratton
f1e92feae2 Allow determining when JS has finished loading in ClientWebView.
* src/client/components/client-web-view.vala (ClientWebView): Add
  is_content_loaded property and content_loaded signal, update and fire
  when getting a contentLoaded message from the WebProcess.

* ui/client-web-view.js: Fire the contentLoaded message when loading is
  complete. Add ClientPageStateTest test case to ensure it is working
  fine.

* test/client/components/client-web-view-test-case.vala
  (ClientWebViewTestCase::load_body_fixture): Use is_content_loaded
  rather than is_loading as the test for loading having finished, since
  we're actually interested in when the JS has finished loaded, not the
  resources.
2017-11-16 12:44:57 +11:00