aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-client-selector.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-02-21 04:41:36 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-02-21 05:35:58 +0800
commit214d832ccdcb79744f6b0a913ee221cb3d725356 (patch)
tree63c2224f3005ce4c66fd0e148728187646fd7f83 /e-util/e-client-selector.c
parent2c195f2266a51cce9499e3bb968d0a7a0ce90091 (diff)
downloadgsoc2013-evolution-214d832ccdcb79744f6b0a913ee221cb3d725356.tar
gsoc2013-evolution-214d832ccdcb79744f6b0a913ee221cb3d725356.tar.gz
gsoc2013-evolution-214d832ccdcb79744f6b0a913ee221cb3d725356.tar.bz2
gsoc2013-evolution-214d832ccdcb79744f6b0a913ee221cb3d725356.tar.lz
gsoc2013-evolution-214d832ccdcb79744f6b0a913ee221cb3d725356.tar.xz
gsoc2013-evolution-214d832ccdcb79744f6b0a913ee221cb3d725356.tar.zst
gsoc2013-evolution-214d832ccdcb79744f6b0a913ee221cb3d725356.zip
Add e_client_selector_is_backend_dead().
Returns TRUE if an EClient instance for the given source and the value of ESourceSelector's "extension-name" property was recently discarded after having emitted a "backend-died" signal, and a replacement EClient instance has not yet been created.
Diffstat (limited to 'e-util/e-client-selector.c')
-rw-r--r--e-util/e-client-selector.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/e-util/e-client-selector.c b/e-util/e-client-selector.c
index bdff0594a3..a38cc381ce 100644
--- a/e-util/e-client-selector.c
+++ b/e-util/e-client-selector.c
@@ -417,3 +417,39 @@ e_client_selector_ref_cached_client (EClientSelector *selector,
return client;
}
+/**
+ * e_client_selector_is_backend_dead:
+ * @selector: an #EClientSelector
+ * @source: an #ESource
+ *
+ * Returns %TRUE if an #EClient instance for @source and the value of
+ * #ESourceSelector:extension-name was recently discarded after having
+ * emitted a #EClient:backend-died signal, and a replacement #EClient
+ * instance has not yet been created.
+ *
+ * Returns: whether the backend for @source died
+ **/
+gboolean
+e_client_selector_is_backend_dead (EClientSelector *selector,
+ ESource *source)
+{
+ EClientCache *client_cache;
+ const gchar *extension_name;
+ gboolean dead_backend;
+
+ g_return_val_if_fail (E_IS_CLIENT_SELECTOR (selector), FALSE);
+ g_return_val_if_fail (E_IS_SOURCE (source), FALSE);
+
+ extension_name = e_source_selector_get_extension_name (
+ E_SOURCE_SELECTOR (selector));
+
+ client_cache = e_client_selector_ref_client_cache (selector);
+
+ dead_backend = e_client_cache_is_backend_dead (
+ client_cache, source, extension_name);
+
+ g_object_unref (client_cache);
+
+ return dead_backend;
+}
+