Commit Graph

32 Commits

Author SHA1 Message Date
7383843653 Reimplement mail_folder_cache_note_store().
* Use GIO-style async parameters.
* Add mail_folder_cache_note_store_finish().
* Do the bulk of the work in a thread so the logic is more readable.
* Queue multiple calls for the same CamelStore and share the results.
2013-07-19 08:36:56 -04:00
209387d4e3 MailFolderCache: Fix a crash when renaming folders. 2013-07-19 08:36:55 -04:00
f371239062 MailFolderCache: Make UpdateClosure less cryptic.
Directly indicate the signal ID to be emitted from the update callback
instead of playing silly games with boolean flags.
2013-07-17 12:08:47 -04:00
4076f0a50b MailFolderCache: Thread-safety improvements and other cleanups.
* Stop using recursive mutexes.
* Give StoreInfo a reference count.
* Give FolderInfo a reference count.
* Track CamelFolders with GWeakRef instead of weak pointers.
* Submit updates directly to the GMainContext, like we do in EDS,
  instead of dequeuing them all from a single idle callback that
  we then have to track.
2013-07-17 12:08:46 -04:00
99d026acbe MailFolderCache: Remove unnecessary "stores" checks.
The "stores" hash table is created on instance init and destroyed with
the cache itself.  It is never NULL during MailFolderCache's lifetime.
2013-07-17 12:08:46 -04:00
060bb07662 mail_folder_cache_get_folder_info_flags: Change parameters.
Take a CamelStore and folder name instead of a CamelFolder.

CamelStore and folder name can easily be obtained from either a folder
URI or a CamelFolder instance, and the function is more efficient with
separate parameters.
2013-07-17 12:08:46 -04:00
c36aa6b749 Add mail_folder_cache_ref_folder().
Replaces mail_folder_cache_get_folder_from_uri().

Returns the CamelFolder for the CamelStore and folder name if available,
or else NULL if a CamelFolder instance is not yet cached.  This function
does not block.
2013-07-17 12:08:46 -04:00
4de5726797 Add mail_folder_cache_has_folder_info().
Returns whether MailFolderCache has information about the folder
described by the CamelStore and folder name.  This does not necessarily
mean it has the CamelFolder instance, but it at least has some meta-data
about it.

You can use this function as a folder existence test.
2013-07-17 12:08:46 -04:00
079fc1a78d MailFolderCache: Add a read-only "main-context" property.
New functions:

  mail_folder_cache_ref_main_context()
2013-07-17 12:08:46 -04:00
3f2d55fb7f MailFolderCache: Remove the "session" property.
I considered replacing the "session" property with a "registry"
property, but that just complicates application startup even more.
Fact is, if we have a CamelStore then we can get the CamelSession
and even the ESourceRegistry from it.  Kinda dirty, but works.

It goes a little something like this...

  camel_service = CAMEL_SERVICE (camel_store);
  camel_session = camel_service_get_session (camel_service);
   mail_session = E_MAIL_SESSION (camel_session);
       registry = e_mail_session_get_registry (mail_session);

Removed functions:

  mail_folder_cache_get_session()
2013-07-17 12:08:46 -04:00
c085e4b445 MailFolderCache: Remove unused "unsub" field. 2013-07-17 12:08:46 -04:00
a877db3749 Remove unused mail_folder_cache_get_folder_has_children(). 2013-07-17 12:08:46 -04:00
1c35d94851 Bug #687412 - Crash under mail_folder_cache_service_removed() 2013-03-25 14:16:36 +01:00
3b11207dcb Use camel_service_ref_session(). 2013-02-11 10:38:29 -05:00
60d1c3054a G_PRIORITY_HIGH_IDLE is sufficient to beat GTK+ redraws.
GTK+ uses (G_PRIORITY_HIGH_IDLE + 20) for redrawing operations, which is
actually a slightly lower priority than G_PRIORITY_HIGH_IDLE.  Therefore
for our purpose, G_PRIORITY_HIGH_IDLE is sufficient.
2013-02-08 14:21:42 -05:00
9c6a7673b8 Add comments around g_idle_add() changes 2013-02-08 18:26:49 +01:00
eb9e927926 Bug #683867 - Schedule actions with higher idle priority 2013-02-08 18:26:48 +01:00
6ba0a6a95b Revert "Bug #683867 - Schedule actions with higher idle priority"
This reverts commit 2b507716b2.

The commit contains not a single comment as to why these custom priority
values are being used.  The rationale needs to be documented in the code,
either at each call point or preferrably at a centralized priority value
definition.
2013-02-08 07:03:26 -05:00
2b507716b2 Bug #683867 - Schedule actions with higher idle priority 2013-02-08 12:37:30 +01:00
d09d8de870 Consolidate base utility libraries into libeutil.
Evolution consists of entirely too many small utility libraries, which
increases linking and loading time, places a burden on higher layers of
the application (e.g. modules) which has to remember to link to all the
small in-tree utility libraries, and makes it difficult to generate API
documentation for these utility libraries in one Gtk-Doc module.

Merge the following utility libraries under the umbrella of libeutil,
and enforce a single-include policy on libeutil so we can reorganize
the files as desired without disrupting its pseudo-public API.

   libemail-utils/libemail-utils.la
   libevolution-utils/libevolution-utils.la
   filter/libfilter.la
   widgets/e-timezone-dialog/libetimezonedialog.la
   widgets/menus/libmenus.la
   widgets/misc/libemiscwidgets.la
   widgets/table/libetable.la
   widgets/text/libetext.la

This also merges libedataserverui from the Evolution-Data-Server module,
since Evolution is its only consumer nowadays, and I'd like to make some
improvements to those APIs without concern for backward-compatibility.

And finally, start a Gtk-Doc module for libeutil.  It's going to be a
project just getting all the symbols _listed_ much less _documented_.
But the skeletal structure is in place and I'm off to a good start.
2012-12-12 14:33:43 -05:00
704b78d23b Replace deprecated GLib symbols (as of GLib 2.34.x) 2012-11-06 16:21:37 +01:00
b0efa5cb27 MailFolderCache: Silently ignore cancellation errors. 2012-10-18 08:37:56 -04:00
5cda0904f9 MailFolderCache: Remove dead code.
No comment as to why it's disabled => has no value.
2012-08-27 17:07:17 -04:00
8a10fa2481 MailFolderCache: Remove some unnecessary #includes. 2012-08-27 17:06:50 -04:00
c85109fc32 Coding style and whitespace cleanup. 2012-08-19 14:17:55 -04:00
82e980001b Always notify about finished updated_folders() call 2012-07-10 10:55:16 +02:00
a36294e7c7 Bug 677995 - Asks password for disabled mail account
Remove mail_folder_cache_service_added() and rely instead on
mail_folder_cache_service_enabled()/disabled().  Despite the function
names the folder cache doesn't actually care about enabled status, it
simply maintains a set of CamelStores to monitor.  We should refactor
the folder cache API to better reflect that.

EMailAccountStore always immediately follows a "service-added" signal
emission with either a "service-enabled" or "service-disabled" emission,
which will add or remove the service from the folder cache.
2012-06-13 11:19:56 -04:00
2a39437ee9 Adapt to single-include E-D-S libraries. 2012-06-03 15:14:03 -04:00
3449e5fcc7 Adapt mail to the new ESource API. 2012-06-02 23:00:40 -04:00
785515dcbd Bug #465076 - INBOX confusion with outbox 2012-04-19 13:46:56 +02:00
23f5773903 Coding style and whitespace cleanup. 2012-02-20 10:04:25 -05:00
61ae36351b Introduce libemail-engine and libemail-utils.
These libraries are bound for E-D-S so they live at the lowest layer of
Evolution for now -- even libeutil can link to them (but please don't).

This is the first step toward moving mail handing to a D-Bus service.
2012-01-18 23:48:47 -05:00