Commit Graph

39 Commits

Author SHA1 Message Date
Milan Crha 570c637480 Fix/mute issues found by Coverity scan
This makes the code free of Coverity scan issues.
It is sometimes quite pedantic and expects/suggests some
coding habits, thus certain changes may look weird, but for a good
thing, I hope. The code is also tagged with Coverity scan
suppressions, to keep the code as is and hide the warning too.
Also note that Coverity treats g_return_if_fail(), g_assert() and
similar macros as unreliable, and it's true these can be disabled
during the compile time, thus it brings in other set of 'weird'
changes.
2013-11-15 09:06:57 +01:00
Matthew Barnes edf8ad6eff "Disco is dead!", says Camel.
All offline-capable Camel providers use CamelOfflineStore now.
2013-11-13 18:15:50 -05:00
Bastien Nocera bc0d5d40ed Bug 710797 - Name all the timeouts added with g_timeout_add() 2013-10-29 15:22:35 -04:00
Matthew Barnes 82010c57ec Adapt to Camel API changes. 2013-09-23 12:03:17 -04:00
Matthew Barnes 3da4948c0f Miscellaneous cleanups. 2013-09-07 19:08:54 -04:00
Matthew Barnes 084974a617 MailFolderCache: Avoid g_signal_handlers_disconnect_matched().
store_info_unref() already disconnects the signal handlers one by one.
2013-08-17 10:29:15 -04:00
Matthew Barnes 660064e202 Bug 704682 - Runtime warning in MailFolderCache 2013-07-27 23:25:35 -04:00
Matthew Barnes 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
Matthew Barnes 209387d4e3 MailFolderCache: Fix a crash when renaming folders. 2013-07-19 08:36:55 -04:00
Matthew Barnes 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
Matthew Barnes 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
Matthew Barnes 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
Matthew Barnes 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
Matthew Barnes 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
Matthew Barnes 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
Matthew Barnes 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
Matthew Barnes 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
Matthew Barnes c085e4b445 MailFolderCache: Remove unused "unsub" field. 2013-07-17 12:08:46 -04:00
Matthew Barnes a877db3749 Remove unused mail_folder_cache_get_folder_has_children(). 2013-07-17 12:08:46 -04:00
Milan Crha 1c35d94851 Bug #687412 - Crash under mail_folder_cache_service_removed() 2013-03-25 14:16:36 +01:00
Matthew Barnes 3b11207dcb Use camel_service_ref_session(). 2013-02-11 10:38:29 -05:00
Matthew Barnes 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
Milan Crha 9c6a7673b8 Add comments around g_idle_add() changes 2013-02-08 18:26:49 +01:00
Michel Dänzer eb9e927926 Bug #683867 - Schedule actions with higher idle priority 2013-02-08 18:26:48 +01:00
Matthew Barnes 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
Michel Dänzer 2b507716b2 Bug #683867 - Schedule actions with higher idle priority 2013-02-08 12:37:30 +01:00
Matthew Barnes 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
Milan Crha 704b78d23b Replace deprecated GLib symbols (as of GLib 2.34.x) 2012-11-06 16:21:37 +01:00
Matthew Barnes b0efa5cb27 MailFolderCache: Silently ignore cancellation errors. 2012-10-18 08:37:56 -04:00
Matthew Barnes 5cda0904f9 MailFolderCache: Remove dead code.
No comment as to why it's disabled => has no value.
2012-08-27 17:07:17 -04:00
Matthew Barnes 8a10fa2481 MailFolderCache: Remove some unnecessary #includes. 2012-08-27 17:06:50 -04:00
Matthew Barnes c85109fc32 Coding style and whitespace cleanup. 2012-08-19 14:17:55 -04:00
Milan Crha 82e980001b Always notify about finished updated_folders() call 2012-07-10 10:55:16 +02:00
Matthew Barnes 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
Matthew Barnes 2a39437ee9 Adapt to single-include E-D-S libraries. 2012-06-03 15:14:03 -04:00
Matthew Barnes 3449e5fcc7 Adapt mail to the new ESource API. 2012-06-02 23:00:40 -04:00
Milan Crha 785515dcbd Bug #465076 - INBOX confusion with outbox 2012-04-19 13:46:56 +02:00
Matthew Barnes 23f5773903 Coding style and whitespace cleanup. 2012-02-20 10:04:25 -05:00
Matthew Barnes 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