diff options
author | Milan Crha <mcrha@redhat.com> | 2011-02-16 20:14:49 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-02-16 20:14:49 +0800 |
commit | 94e43758de5e90ff3acf70654a53ddf787495f1b (patch) | |
tree | 0f7e8bd91d339d92f94221cf61e1623624fdbeba /mail | |
parent | fd0b59503481461304b8c9818066eb7ce28dfe25 (diff) | |
download | gsoc2013-evolution-94e43758de5e90ff3acf70654a53ddf787495f1b.tar gsoc2013-evolution-94e43758de5e90ff3acf70654a53ddf787495f1b.tar.gz gsoc2013-evolution-94e43758de5e90ff3acf70654a53ddf787495f1b.tar.bz2 gsoc2013-evolution-94e43758de5e90ff3acf70654a53ddf787495f1b.tar.lz gsoc2013-evolution-94e43758de5e90ff3acf70654a53ddf787495f1b.tar.xz gsoc2013-evolution-94e43758de5e90ff3acf70654a53ddf787495f1b.tar.zst gsoc2013-evolution-94e43758de5e90ff3acf70654a53ddf787495f1b.zip |
Bug #638333 - Critical warning when invoking File->New->Mail Folder
Diffstat (limited to 'mail')
-rw-r--r-- | mail/em-folder-selector.c | 2 | ||||
-rw-r--r-- | mail/em-folder-tree.c | 11 | ||||
-rw-r--r-- | mail/em-folder-utils.c | 12 | ||||
-rw-r--r-- | mail/em-folder-utils.h | 1 |
4 files changed, 17 insertions, 9 deletions
diff --git a/mail/em-folder-selector.c b/mail/em-folder-selector.c index b05ba3549d..514493664e 100644 --- a/mail/em-folder-selector.c +++ b/mail/em-folder-selector.c @@ -116,7 +116,7 @@ emfs_response (GtkWidget *dialog, gint response, EMFolderSelector *emfs) g_object_set_data ((GObject *)emfs->emft, "select", GUINT_TO_POINTER (1)); - em_folder_utils_create_folder (NULL, emfs->emft, GTK_WINDOW (dialog)); + em_folder_utils_create_folder (NULL, emfs->emft, em_folder_tree_get_session (emfs->emft), GTK_WINDOW (dialog)); g_signal_stop_emission_by_name (emfs, "response"); } diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index 51a116f643..69a34357a6 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -64,6 +64,7 @@ #include "e-mail-local.h" #include "e-mail-session.h" +#include "e-mail-store.h" #define d(x) @@ -1695,8 +1696,18 @@ em_folder_tree_get_type (void) GtkWidget * em_folder_tree_new (EMailSession *session) { + const gchar *data_dir; + EShell *default_shell; + EShellBackend *mail_backend; + g_return_val_if_fail (E_IS_MAIL_SESSION (session), NULL); + default_shell = e_shell_get_default (); + mail_backend = e_shell_get_backend_by_name (default_shell, "mail"); + data_dir = e_shell_backend_get_data_dir (mail_backend); + + e_mail_store_init (session, data_dir); + return g_object_new ( EM_TYPE_FOLDER_TREE, "session", session, NULL); } diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c index e84152e574..eed9298f07 100644 --- a/mail/em-folder-utils.c +++ b/mail/em-folder-utils.c @@ -650,11 +650,11 @@ new_folder_created_cb (CamelFolderInfo *fi, gpointer user_data) { struct _EMCreateFolderTempData *emcftd=user_data; if (fi) { - gtk_widget_destroy ((GtkWidget *) emcftd->emfs); - /* Exapnding newly created folder */ if (emcftd->emft) em_folder_tree_set_selected ((EMFolderTree *) emcftd->emft, emcftd->uri, GPOINTER_TO_INT(g_object_get_data ((GObject *)emcftd->emft, "select")) ? FALSE : TRUE); + + gtk_widget_destroy ((GtkWidget *) emcftd->emfs); } g_object_unref (emcftd->emfs); g_free (emcftd->uri); @@ -727,16 +727,12 @@ emfu_popup_new_folder_response (EMFolderSelector *emfs, void em_folder_utils_create_folder (CamelFolderInfo *folderinfo, EMFolderTree *emft, + EMailSession *session, GtkWindow *parent) { EMFolderTree *folder_tree; - EMailSession *session; GtkWidget *dialog; - g_return_if_fail (EM_IS_FOLDER_TREE (emft)); - - session = em_folder_tree_get_session (emft); - folder_tree = (EMFolderTree *) em_folder_tree_new (session); emu_restore_folder_tree_state (folder_tree); @@ -746,7 +742,7 @@ em_folder_utils_create_folder (CamelFolderInfo *folderinfo, _("Specify where to create the folder:")); if (folderinfo != NULL) em_folder_selector_set_selected ((EMFolderSelector *) dialog, folderinfo->uri); - g_signal_connect (dialog, "response", G_CALLBACK (emfu_popup_new_folder_response), emft); + g_signal_connect (dialog, "response", G_CALLBACK (emfu_popup_new_folder_response), emft ? emft : folder_tree); if (!parent || !GTK_IS_DIALOG (parent)) gtk_widget_show (dialog); diff --git a/mail/em-folder-utils.h b/mail/em-folder-utils.h index 9d937d2424..03aacc15fd 100644 --- a/mail/em-folder-utils.h +++ b/mail/em-folder-utils.h @@ -48,6 +48,7 @@ void em_folder_utils_delete_folder (EMailBackend *backend, CamelFolder *folder); void em_folder_utils_create_folder (CamelFolderInfo *folderinfo, EMFolderTree *emft, + EMailSession *session, GtkWindow *parent); const gchar * em_folder_utils_get_icon_name (guint32 flags); |