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 6dd6672b79098f796548527ec2a4d456e3d636be..8de176978caf9fdbb677e5b8c1abe67cd110204b 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 a4e885cfaad1c32313585327501b330e1bbdd546..2c87c67649365e64ca0ba9b3bfba9a8f5b20f4aa 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 4607c41b49e0c4e52e88da9ac3e0bc5187f64c05..8c5aa3d2536b91830f7458e93835bc3523c1c602 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 0423c0a2e7aaf47b8fc035eff201d5dc623c9bb1..bbc29810a6d91eb653fd8831596328aa990fcd64 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 7931db9911862a2e3f87df23f986c3108d18266e..15dc99d72ee94b1099abd1d60b16aea53d06c4b3 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 253f26f0c1d8d5c8d548bb275634b06c8b4f1d45..e2dc1aca41cdb7c5364accf71c2e57bc60c76f91 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;
+}