0.8.11claws7
[claws.git] / src / mainwindow.c
index 2191fe8b118d9dbd89caf18c9b13a49abc27f6f5..0aa6c4924ffe71c1531dcefa200d4b30ea54a67b 100644 (file)
@@ -1392,10 +1392,9 @@ void main_window_add_mailbox(MainWindow *mainwin)
                g_free(path);
                return;
        }
-       if (!strcmp(path, "Mail"))
-               folder = folder_new(F_MH, _("Mailbox"), path);
-       else
-               folder = folder_new(F_MH, g_basename(path), path);
+       folder = folder_new(folder_get_class_from_string("mh"), 
+                           !strcmp(path, "Mail") ? _("Mailbox") : g_basename(path),
+                           path);
        g_free(path);
 
        if (folder->class->create_tree(folder) < 0) {
@@ -1431,13 +1430,8 @@ void main_window_add_mbox(MainWindow *mainwin)
                return;
        }
 
-       /*
-       if (!strcmp(path, "Mail"))
-               folder = folder_new(F_MBOX, _("Mailbox"), path);
-               else
-       */
-
-       folder = folder_new(F_MBOX, g_basename(path), path);
+       folder = folder_new(folder_get_class_from_string("mbox"), 
+                           g_basename(path), path);
        g_free(path);
 
        if (folder->class->create_tree(folder) < 0) {