* Fixes NB#91689. fixes a wrong check for ASCII
[modest] / src / modest-runtime.c
index b7fa5e7..2097db5 100644 (file)
@@ -86,9 +86,16 @@ 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) {
+               modest_signal_mgr_disconnect_all_and_destroy (_sig_handlers);
+               _sig_handlers = NULL;
+       }
+
+       g_debug ("%s: cleaned up signal manager", __FUNCTION__);
+
        MODEST_DEBUG_VERIFY_OBJECT_LAST_REF(_singletons,"");
        g_object_unref(_singletons);
        _singletons = NULL;
@@ -104,11 +111,6 @@ modest_runtime_uninit (void)
        g_debug ("%s: cleaned up the account store", __FUNCTION__);
 
        
-       if (_sig_handlers) {
-               modest_signal_mgr_disconnect_all_and_destroy (_sig_handlers);
-               _sig_handlers = NULL;
-       }
-
        g_debug ("%s: all cleaned up", __FUNCTION__);
 
        
@@ -124,6 +126,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)
 {
@@ -211,26 +220,27 @@ modest_runtime_get_send_queue  (TnyTransportAccount *account,
            create) {
                /* Note that this send queue will start sending messages from its outbox 
                 * as soon as it is instantiated: */
-               send_queue = (gpointer)modest_tny_send_queue_new (TNY_CAMEL_TRANSPORT_ACCOUNT(account));
-
-               _sig_handlers = 
-                       modest_signal_mgr_connect (_sig_handlers, 
-                                                  send_queue, 
-                                                  "error_happened",
-                                                  G_CALLBACK (modest_ui_actions_on_send_queue_error_happened), 
-                                                  NULL);
-
-               _sig_handlers = 
-                       modest_signal_mgr_connect (_sig_handlers, 
-                                                  send_queue, 
-                                                  "status_changed",
-                                                  G_CALLBACK (modest_ui_actions_on_send_queue_status_changed), 
-                                                  NULL);
-
-
-               g_hash_table_insert (send_queue_cache, 
-                                    g_object_ref (account), 
-                                    g_object_ref (send_queue));
+               send_queue = modest_tny_send_queue_new (TNY_CAMEL_TRANSPORT_ACCOUNT(account));
+
+               if (send_queue) {
+                       _sig_handlers = 
+                               modest_signal_mgr_connect (_sig_handlers, 
+                                                          send_queue, 
+                                                          "error_happened",
+                                                          G_CALLBACK (modest_ui_actions_on_send_queue_error_happened), 
+                                                          NULL);
+
+                       _sig_handlers = 
+                               modest_signal_mgr_connect (_sig_handlers, 
+                                                          send_queue, 
+                                                          "status_changed",
+                                                          G_CALLBACK (modest_ui_actions_on_send_queue_status_changed), 
+                                                          NULL);
+
+                       g_hash_table_insert (send_queue_cache, 
+                                            g_object_ref (account), 
+                                            send_queue);
+               }
        }
 
        return (send_queue) ? MODEST_TNY_SEND_QUEUE(send_queue) : NULL;
@@ -268,6 +278,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 ()