0.8.11claws66
authorChristoph Hohmann <reboot@gmx.ch>
Sun, 30 Mar 2003 14:02:37 +0000 (14:02 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Sun, 30 Mar 2003 14:02:37 +0000 (14:02 +0000)
* src/folder.c
        don't use default folder for processing folder item because
        it can be a non local folder

(fixes bug reported by Stephen Lewis <slewis@paradise.net.nz>)

ChangeLog.claws
configure.ac
src/folder.c

index cf7619fe951ecb9380bcc0a25d737fa76bb7abe7..bf22c997778511016cdd1c6362eaa2bf85f11987 100644 (file)
@@ -1,3 +1,11 @@
+2003-03-30 [christoph] 0.8.11claws66
+
+       * src/folder.c
+               don't use default folder for processing folder item because
+               it can be a non local folder
+
+       (fixes bug reported by Stephen Lewis <slewis@paradise.net.nz>)
+
 2003-03-30 [alfons]    0.8.11claws65
 
        * src/send_message.c
 2003-03-30 [alfons]    0.8.11claws65
 
        * src/send_message.c
index 2c11053b024823b9f74952dd558d0b6128154b81..db345d3fd96b7cb07e8a8cf68d8a038294cd7176 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws65
+EXTRA_VERSION=claws66
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index ee4ea11a2e287b4cd96cc4e5a2c35524c32960ea..6de75e00f9bc2ad11f6da9c8d90d2fd253bd8937 100644 (file)
@@ -2585,44 +2585,51 @@ static gchar * folder_item_get_tree_identifier(FolderItem * item)
 */
 
 /* CLAWS: temporary local folder for filtering */
 */
 
 /* CLAWS: temporary local folder for filtering */
-static Folder *processing_folder;
+#define TEMP_FOLDER "TEMP_FOLDER"
+#define PROCESSING_FOLDER_ITEM "processing"    
+
 static FolderItem *processing_folder_item;
 
 static void folder_create_processing_folder(void)
 {
 static FolderItem *processing_folder_item;
 
 static void folder_create_processing_folder(void)
 {
-#define PROCESSING_FOLDER ".processing"        
-       Folder     *tmpparent;
+       Folder *processing_folder;
        gchar      *tmpname;
 
        gchar      *tmpname;
 
-       tmpparent = folder_get_default_folder();
-       g_assert(tmpparent);
-       debug_print("tmpparentroot %s\n", LOCAL_FOLDER(tmpparent)->rootpath);
-       if (LOCAL_FOLDER(tmpparent)->rootpath[0] == '/')
-               tmpname = g_strconcat(LOCAL_FOLDER(tmpparent)->rootpath,
-                                     G_DIR_SEPARATOR_S, PROCESSING_FOLDER,
+       if ((processing_folder = folder_find_from_name(TEMP_FOLDER, mh_get_class())) == NULL) {
+               gchar *tmppath;
+
+               tmppath =
+                   g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
+                               "tempfolder", NULL);
+               processing_folder =
+                   folder_new(mh_get_class(), TEMP_FOLDER, tmppath);
+               g_free(tmppath);
+       }
+       g_assert(processing_folder != NULL);
+
+       debug_print("tmpparentroot %s\n", LOCAL_FOLDER(processing_folder)->rootpath);
+       if (LOCAL_FOLDER(processing_folder)->rootpath[0] == '/')
+               tmpname = g_strconcat(LOCAL_FOLDER(processing_folder)->rootpath,
+                                     G_DIR_SEPARATOR_S, PROCESSING_FOLDER_ITEM,
                                      NULL);
        else
                tmpname = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S,
                                      NULL);
        else
                tmpname = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S,
-                                     LOCAL_FOLDER(tmpparent)->rootpath,
-                                     G_DIR_SEPARATOR_S, PROCESSING_FOLDER,
+                                     LOCAL_FOLDER(processing_folder)->rootpath,
+                                     G_DIR_SEPARATOR_S, PROCESSING_FOLDER_ITEM,
                                      NULL);
 
                                      NULL);
 
-       processing_folder = folder_new(mh_get_class(), "PROCESSING", LOCAL_FOLDER(tmpparent)->rootpath);
-       g_assert(processing_folder);
-
        if (!is_dir_exist(tmpname)) {
                debug_print("*TMP* creating %s\n", tmpname);
                processing_folder_item = processing_folder->class->create_folder(processing_folder,
                                                                                 processing_folder->node->data,
        if (!is_dir_exist(tmpname)) {
                debug_print("*TMP* creating %s\n", tmpname);
                processing_folder_item = processing_folder->class->create_folder(processing_folder,
                                                                                 processing_folder->node->data,
-                                                                                PROCESSING_FOLDER);
-               g_assert(processing_folder_item);                                                                         
-       }
-       else {
+                                                                                PROCESSING_FOLDER_ITEM);
+       } else {
                debug_print("*TMP* already created\n");
                processing_folder_item = folder_item_new(processing_folder, ".processing", ".processing");
                g_assert(processing_folder_item);
                folder_item_append(processing_folder->node->data, processing_folder_item);
        }
                debug_print("*TMP* already created\n");
                processing_folder_item = folder_item_new(processing_folder, ".processing", ".processing");
                g_assert(processing_folder_item);
                folder_item_append(processing_folder->node->data, processing_folder_item);
        }
+       g_assert(processing_folder_item != NULL);
        g_free(tmpname);
 }
 
        g_free(tmpname);
 }