0.9.4claws72
authorChristoph Hohmann <reboot@gmx.ch>
Mon, 8 Sep 2003 11:41:03 +0000 (11:41 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Mon, 8 Sep 2003 11:41:03 +0000 (11:41 +0000)
* src/folder.c
* src/folderview.c
* src/mainwindow.c
        fix new folder notification

* src/mbox_folder.c
        fix cache path

ChangeLog.claws
configure.ac
src/folder.c
src/folderview.c
src/mainwindow.c
src/mbox_folder.c

index 6dd6672..8de1769 100644 (file)
@@ -1,4 +1,14 @@
-2003-09-07 [christoph] 0.9.4claws71
+2003-09-08 [christoph] 0.9.4claws72
+
+       * src/folder.c
+       * src/folderview.c
+       * src/mainwindow.c
+               fix new folder notification
+
+       * src/mbox_folder.c
+               fix cache path
+
+2003-09-08 [christoph] 0.9.4claws71
 
        * src/compose.c
                replace '\n' and '\r' before removing trailing spaces
index a4e885c..2c87c67 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=4
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=71
+EXTRA_VERSION=72
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index 4607c41..8c5aa3d 100644 (file)
@@ -217,8 +217,6 @@ FolderItem *folder_item_new(Folder *folder, const gchar *name, const gchar *path
 
 void folder_item_append(FolderItem *parent, FolderItem *item)
 {
-       FolderUpdateData hookdata;
-
        g_return_if_fail(parent != NULL);
        g_return_if_fail(parent->folder != NULL);
        g_return_if_fail(parent->node != NULL);
@@ -227,31 +225,25 @@ void folder_item_append(FolderItem *parent, FolderItem *item)
        item->parent = parent;
        item->folder = parent->folder;
        item->node = g_node_append_data(parent->node, item);
-
-       hookdata.folder = item->folder;
-       hookdata.update_flags = FOLDER_TREE_CHANGED | FOLDER_NEW_FOLDERITEM;
-       hookdata.item = item;
-       hooks_invoke(FOLDER_UPDATE_HOOKLIST, &hookdata);
 }
 
 static gboolean folder_item_remove_func(GNode *node, gpointer data)
 {
        FolderItem *item = FOLDER_ITEM(node->data);
        FolderUpdateData hookdata;
-       Folder *folder = item->folder;
 
        if (item->cache != NULL) {
                msgcache_destroy(item->cache);
                item->cache = NULL;
        }
 
-       folder_item_destroy(item);
-
-       hookdata.folder = folder;
+       hookdata.folder = item->folder;
        hookdata.update_flags = FOLDER_TREE_CHANGED | FOLDER_REMOVE_FOLDERITEM;
        hookdata.item = item;
        hooks_invoke(FOLDER_UPDATE_HOOKLIST, &hookdata);
 
+       folder_item_destroy(item);
+
        return FALSE;
 }
 
@@ -503,11 +495,17 @@ void folder_scan_tree(Folder *folder)
 FolderItem *folder_create_folder(FolderItem *parent, const gchar *name)
 {
        FolderItem *new_item;
+       FolderUpdateData hookdata;
 
        new_item = parent->folder->klass->create_folder(parent->folder, parent, name);
        if (new_item)
                new_item->cache = msgcache_new();
 
+       hookdata.folder = new_item->folder;
+       hookdata.update_flags = FOLDER_TREE_CHANGED | FOLDER_NEW_FOLDERITEM;
+       hookdata.item = new_item;
+       hooks_invoke(FOLDER_UPDATE_HOOKLIST, &hookdata);
+
        return new_item;
 }
 
index 0423c0a..bbc2981 100644 (file)
@@ -1852,6 +1852,8 @@ void folderview_create_folder_node(FolderView *folderview, FolderItem *item)
        GtkCTreeNode *node, *parent_node;
        
        parent_node = gtk_ctree_find_by_row_data(ctree, NULL, item->parent);
+       if (parent_node == NULL)
+               return;
 
        gtk_clist_freeze(GTK_CLIST(ctree));
 
index 7931db9..15dc99d 100644 (file)
@@ -1511,16 +1511,6 @@ void main_window_add_mbox(MainWindow *mainwin)
 
        folder_add(folder);
 
-       item = folder_item_new(folder, folder->name, NULL);
-       item->folder = folder;
-       folder->node = g_node_new(item);
-
-       folder_create_folder(item, "inbox");
-       folder_create_folder(item, "outbox");
-       folder_create_folder(item, "queue");
-       folder_create_folder(item, "draft");
-       folder_create_folder(item, "trash");
-
        folderview_set(mainwin->folderview);
 }
 
index 253f26f..e2dc1ac 100644 (file)
@@ -72,6 +72,7 @@ static gint mbox_get_num_list(Folder *folder, FolderItem *item,
                              GSList **list, gboolean *old_uids_valid);
 static gboolean mbox_scan_required(Folder *folder, FolderItem *item);
 static gchar *mbox_folder_get_path(Folder *folder, FolderItem *item);
+static gchar *mbox_item_get_path(Folder *folder, FolderItem *item);
 
 FolderClass mbox_class =
 {
@@ -88,7 +89,7 @@ FolderClass mbox_class =
        /* FolderItem functions */
        NULL,
        NULL,
-       mbox_folder_get_path,
+       mbox_item_get_path,
        mbox_create_folder,
        mbox_rename_folder,
        mbox_remove_folder,
@@ -2204,3 +2205,16 @@ gboolean mbox_scan_required(Folder *folder, FolderItem *item)
        return !scan_new;
 }
 
+static gchar *mbox_item_get_path(Folder *folder, FolderItem *item)
+{
+       gchar *itempath, *path;
+
+        itempath = mbox_get_virtual_path(item);         
+        if (itempath == NULL)   
+               return NULL;     
+        path = g_strconcat(get_mbox_cache_dir(),        
+                           G_DIR_SEPARATOR_S, itempath, NULL);  
+        g_free(itempath);
+
+       return path;
+}