* fixed bug which crashed modest after sending an email with attachment(s). The attac...
[modest] / src / modest-main.c
index 5f97692..0804f1c 100644 (file)
@@ -5,6 +5,7 @@
 #include "modest-account-mgr.h"
 #include "modest-identity-mgr.h"
 #include "modest-ui.h"
+#include "modest-icon-factory.h"
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -72,30 +73,28 @@ main (int argc, char *argv[])
                goto cleanup;
        }
 
+       gtk_init (&argc, &argv);
+
+       modest_icon_factory_init ();
+
        if (reinstall) {
                modest_conf_remove_key (modest_conf, MODEST_CONF_NAMESPACE, NULL);
                install_basic_conf_settings (modest_conf);
-               install_test_account (modest_conf);
                goto cleanup;
        }
 
-
-
-       gtk_init (&argc, &argv);
-
-       modest_icon_factory_init ();
-       
        modest_ui = MODEST_UI(modest_ui_new (modest_conf));
        if (!modest_ui) {
                g_warning ("failed to initialize ui");
                goto cleanup;
        }
-       
+
        {
                gboolean ok;
                gtk_init (&argc, &argv);
 
-               if (mailto||cc||bcc||subject||body)
+               if (mailto||cc||bcc||subject||body) {
+#if 0
                        ok = modest_ui_new_edit_window (modest_ui,
                                                         mailto,  /* to */
                                                         cc,      /* cc */
@@ -103,7 +102,8 @@ main (int argc, char *argv[])
                                                         subject,    /* subject */
                                                         body,    /* body */
                                                         NULL);   /* attachments */
-               else
+#endif
+               } else
                        ok = modest_ui_show_main_window (modest_ui);
 
                if (!ok)
@@ -182,7 +182,7 @@ install_test_account (ModestConf *conf)
                                                       NULL, "imap");
                modest_account_mgr_add_server_account (acc_mgr, "mytransport", "localhost", NULL,
                                                       NULL, "smtp");
-               
+
        }
        id_mgr = MODEST_IDENTITY_MGR(modest_identity_mgr_new (conf));
        if (modest_identity_mgr_identity_exists(id_mgr, "myidentity", NULL)) {
@@ -192,10 +192,11 @@ install_test_account (ModestConf *conf)
        }
        if (!modest_identity_mgr_add_identity (id_mgr,
                                               MODEST_IDENTITY_DEFAULT_IDENTITY,
+                                              "Default User",
                                               "user@localhost",
                                               "", "", FALSE, NULL, FALSE ))
                g_warning ("failed to add test identity");
-       
+
        g_object_unref (G_OBJECT(acc_mgr));
        g_object_unref (G_OBJECT(id_mgr));
 }