X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-runtime.c;h=f3ec8b6e0268c4d91e18d45f28fa8d6acf43c522;hp=7b1f186c8cf07b9017a03d9e20109722711aab5b;hb=04bf2b796e99e2a4f9181db353e5890be6ca986a;hpb=145d5bece6eb16b437c827ea7b70bcfed236b03f diff --git a/src/modest-runtime.c b/src/modest-runtime.c index 7b1f186..f3ec8b6 100644 --- a/src/modest-runtime.c +++ b/src/modest-runtime.c @@ -57,6 +57,9 @@ static ModestTnyAccountStore *_account_store = NULL; /* Signal handlers for the send queues */ static GSList *_sig_handlers = NULL; +/* will modest shut down when window list and mail op queue are empty? */ +static gboolean _allow_shutdown = FALSE; + /* * private functions declared in modest-runtime-priv.h - * only to be called from modest-init.c @@ -69,13 +72,13 @@ modest_runtime_init (void) g_printerr ("modest: modest_runtime_init can only be run once\n"); return FALSE; } - + _singletons = modest_singletons_new (); if (!_singletons) { g_printerr ("modest: failed to create singletons\n"); return FALSE; } - + return TRUE; } @@ -86,7 +89,7 @@ modest_runtime_uninit (void) return TRUE; /* uninit maybe called if runtime_init failed */ g_return_val_if_fail (MODEST_IS_SINGLETONS(_singletons), FALSE); - + g_debug ("%s: cleaning up", __FUNCTION__); if (_sig_handlers) { @@ -126,6 +129,13 @@ modest_runtime_get_account_mgr (void) return modest_singletons_get_account_mgr (_singletons); } +TnyStreamCache* +modest_runtime_get_images_cache (void) +{ + g_return_val_if_fail (_singletons, NULL); + return modest_singletons_get_images_cache (_singletons); +} + ModestEmailClipboard* modest_runtime_get_email_clipboard (void) { @@ -136,9 +146,10 @@ modest_runtime_get_email_clipboard (void) ModestTnyAccountStore* modest_runtime_get_account_store (void) { - // we get the account store here instead of in Singletons - // as it leads to various chicken & problems with initialization - g_return_val_if_fail (_singletons, NULL); + g_return_val_if_fail (_singletons, NULL); + /* we get the account store here instead of in Singletons as + it leads to various chicken & egg problems with + initialization */ if (!_account_store) { _account_store = modest_tny_account_store_new (modest_runtime_get_account_mgr(), modest_runtime_get_device()); @@ -271,6 +282,20 @@ modest_runtime_get_window_mgr (void) return modest_singletons_get_window_mgr (_singletons); } +ModestPluginFactory * +modest_runtime_get_plugin_factory (void) +{ + g_return_val_if_fail (_singletons, NULL); + return modest_singletons_get_plugin_factory (_singletons); +} + +ModestProtocolRegistry * +modest_runtime_get_protocol_registry (void) +{ + g_return_val_if_fail (_singletons, NULL); + return modest_singletons_get_protocol_registry (_singletons); +} + /* http://primates.ximian.com/~federico/news-2006-04.html#memory-debugging-infrastructure*/ ModestRuntimeDebugFlags modest_runtime_get_debug_flags () @@ -299,6 +324,14 @@ modest_runtime_get_debug_flags () return debug_flags; } +gboolean +modest_runtime_get_allow_shutdown (void) +{ + return _allow_shutdown; +} - - +void +modest_runtime_set_allow_shutdown (gboolean allow) +{ + _allow_shutdown = allow; +}