aboutsummaryrefslogtreecommitdiffstats
path: root/mail/importers
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-10-17 11:48:03 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-10-17 11:48:03 +0800
commit54b80a7271e8ce1b2f3ccc68bb553940a24b80e2 (patch)
tree74dd75a7dca547164ff4be88c07d407517663105 /mail/importers
parent79aa45cfed7e87150de85869795ef0dd3be06db0 (diff)
downloadgsoc2013-evolution-54b80a7271e8ce1b2f3ccc68bb553940a24b80e2.tar.gz
gsoc2013-evolution-54b80a7271e8ce1b2f3ccc68bb553940a24b80e2.tar.zst
gsoc2013-evolution-54b80a7271e8ce1b2f3ccc68bb553940a24b80e2.zip
Get the mail folder tree compiling, though I'm not yet sure why it's not
showing anything. Probably something stupid. Also enabled the composer. svn path=/branches/kill-bonobo/; revision=36623
Diffstat (limited to 'mail/importers')
-rw-r--r--mail/importers/evolution-mbox-importer.c14
-rw-r--r--mail/importers/mail-importer.c11
2 files changed, 17 insertions, 8 deletions
diff --git a/mail/importers/evolution-mbox-importer.c b/mail/importers/evolution-mbox-importer.c
index 2943772b68..36cf8768ff 100644
--- a/mail/importers/evolution-mbox-importer.c
+++ b/mail/importers/evolution-mbox-importer.c
@@ -40,9 +40,8 @@
#include <camel/camel-exception.h>
+#include "mail/e-mail-shell-module.h"
#include "mail/em-folder-selection-button.h"
-
-#include "mail/mail-component.h"
#include "mail/mail-mt.h"
#include "mail-importer.h"
@@ -73,15 +72,20 @@ static GtkWidget *
mbox_getwidget(EImport *ei, EImportTarget *target, EImportImporter *im)
{
GtkWidget *hbox, *w;
+ EMFolderTreeModel *model;
+ const gchar *local_inbox_folder_uri;
+
+ local_inbox_folder_uri = e_mail_shell_module_get_folder_uri (
+ mail_shell_module, E_MAIL_FOLDER_INBOX);
+ model = e_mail_shell_module_get_folder_tree_model (mail_shell_module);
hbox = gtk_hbox_new(FALSE, 0);
w = gtk_label_new(_("Destination folder:"));
gtk_box_pack_start((GtkBox *)hbox, w, FALSE, TRUE, 6);
- w = em_folder_selection_button_new(_("Select folder"), _("Select folder to import into"));
- em_folder_selection_button_set_selection((EMFolderSelectionButton *)w,
- mail_component_get_folder_uri(NULL, MAIL_COMPONENT_FOLDER_INBOX));
+ w = em_folder_selection_button_new(model, _("Select folder"), _("Select folder to import into"));
+ em_folder_selection_button_set_selection((EMFolderSelectionButton *)w, local_inbox_folder_uri);
g_signal_connect(w, "selected", G_CALLBACK(folder_selected), target);
gtk_box_pack_start((GtkBox *)hbox, w, FALSE, TRUE, 6);
diff --git a/mail/importers/mail-importer.c b/mail/importers/mail-importer.c
index 3f26cddb7f..45dac0e11c 100644
--- a/mail/importers/mail-importer.c
+++ b/mail/importers/mail-importer.c
@@ -49,6 +49,7 @@
#include "mail/mail-mt.h"
#include "mail/mail-tools.h"
+#include "mail/e-mail-shell-module.h"
#include "mail-importer.h"
@@ -202,7 +203,8 @@ import_mbox_exec (struct _import_mbox_msg *m)
}
if (m->uri == NULL || m->uri[0] == 0)
- folder = mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_INBOX);
+ folder = e_mail_shell_module_get_folder (
+ mail_shell_module, E_MAIL_FOLDER_INBOX);
else
folder = mail_tool_uri_to_folder(m->uri, CAMEL_STORE_FOLDER_CREATE, &m->base.ex);
@@ -359,6 +361,7 @@ import_folders_rec(struct _import_folders_data *m, const char *filepath, const c
GDir *dir;
const char *d;
struct stat st;
+ const gchar *data_dir;
char *filefull, *foldersub, *uri, *utf8_filename;
const char *folder;
@@ -366,6 +369,8 @@ import_folders_rec(struct _import_folders_data *m, const char *filepath, const c
if (dir == NULL)
return;
+ data_dir = e_shell_module_get_data_dir (mail_shell_module);
+
utf8_filename = g_filename_to_utf8 (filepath, -1, NULL, NULL, NULL);
camel_operation_start(NULL, _("Scanning %s"), utf8_filename);
g_free (utf8_filename);
@@ -394,9 +399,9 @@ import_folders_rec(struct _import_folders_data *m, const char *filepath, const c
break;
}
/* FIXME: need a better way to get default store location */
- uri = g_strdup_printf("mbox:%s/local#%s", mail_component_peek_base_directory(NULL), folder);
+ uri = g_strdup_printf("mbox:%s/local#%s", data_dir, folder);
} else {
- uri = g_strdup_printf("mbox:%s/local#%s/%s", mail_component_peek_base_directory(NULL), folderparent, folder);
+ uri = g_strdup_printf("mbox:%s/local#%s/%s", data_dir, folderparent, folder);
}
printf("importing to uri %s\n", uri);