diff options
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/e-client-selector.c | 36 | ||||
-rw-r--r-- | e-util/e-client-selector.h | 3 |
2 files changed, 39 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; +} + diff --git a/e-util/e-client-selector.h b/e-util/e-client-selector.h index 25974237d1..8e3c1ac12f 100644 --- a/e-util/e-client-selector.h +++ b/e-util/e-client-selector.h @@ -82,6 +82,9 @@ EClient * e_client_selector_get_client_finish EClient * e_client_selector_ref_cached_client (EClientSelector *selector, ESource *source); +gboolean e_client_selector_is_backend_dead + (EClientSelector *selector, + ESource *source); #endif /* E_CLIENT_SELECTOR_H */ |