0.9.10claws63
authorChristoph Hohmann <reboot@gmx.ch>
Mon, 17 May 2004 14:52:20 +0000 (14:52 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Mon, 17 May 2004 14:52:20 +0000 (14:52 +0000)
* src/folder.c
        search all folders when searching for default folders and
        not return the special folder of the first folder

ChangeLog.claws
configure.ac
src/folder.c

index 47a3ac0..6919ee5 100644 (file)
@@ -1,3 +1,9 @@
+2004-05-17 [christoph] 0.9.10claws63
+
+       * src/folder.c
+               search all folders when searching for default folders and
+               not return the special folder of the first folder
+
 2004-05-13 [alfons]    0.9.10claws62
 
        * src/summaryview.c
index bb19b83..e815c7d 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=62
+EXTRA_VERSION=63
 
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
index 70276d5..256dbca 100644 (file)
@@ -1220,52 +1220,92 @@ Folder *folder_get_default_folder(void)
 
 FolderItem *folder_get_default_inbox(void)
 {
-       Folder *folder;
+       GList *flist;
 
-       if (!folder_list) return NULL;
-       folder = FOLDER(folder_list->data);
-       g_return_val_if_fail(folder != NULL, NULL);
-       return folder->inbox;
+       for (flist = folder_list; flist != NULL; flist = g_list_next(flist)) {
+               Folder * folder = FOLDER(flist->data);
+
+               if (folder == NULL)
+                       continue;
+               if (folder->inbox == NULL)
+                       continue;
+
+               return folder->inbox;
+       }
+
+       return NULL;
 }
 
 FolderItem *folder_get_default_outbox(void)
 {
-       Folder *folder;
+       GList *flist;
 
-       if (!folder_list) return NULL;
-       folder = FOLDER(folder_list->data);
-       g_return_val_if_fail(folder != NULL, NULL);
-       return folder->outbox;
+       for (flist = folder_list; flist != NULL; flist = g_list_next(flist)) {
+               Folder * folder = FOLDER(flist->data);
+
+               if (folder == NULL)
+                       continue;
+               if (folder->outbox == NULL)
+                       continue;
+
+               return folder->outbox;
+       }
+
+       return NULL;
 }
 
 FolderItem *folder_get_default_draft(void)
 {
-       Folder *folder;
+       GList *flist;
 
-       if (!folder_list) return NULL;
-       folder = FOLDER(folder_list->data);
-       g_return_val_if_fail(folder != NULL, NULL);
-       return folder->draft;
+       for (flist = folder_list; flist != NULL; flist = g_list_next(flist)) {
+               Folder * folder = FOLDER(flist->data);
+
+               if (folder == NULL)
+                       continue;
+               if (folder->draft == NULL)
+                       continue;
+
+               return folder->draft;
+       }
+
+       return NULL;
 }
 
 FolderItem *folder_get_default_queue(void)
 {
-       Folder *folder;
+       GList *flist;
 
-       if (!folder_list) return NULL;
-       folder = FOLDER(folder_list->data);
-       g_return_val_if_fail(folder != NULL, NULL);
-       return folder->queue;
+       for (flist = folder_list; flist != NULL; flist = g_list_next(flist)) {
+               Folder * folder = FOLDER(flist->data);
+
+               if (folder == NULL)
+                       continue;
+               if (folder->queue == NULL)
+                       continue;
+
+               return folder->queue;
+       }
+
+       return NULL;
 }
 
 FolderItem *folder_get_default_trash(void)
 {
-       Folder *folder;
+       GList *flist;
 
-       if (!folder_list) return NULL;
-       folder = FOLDER(folder_list->data);
-       g_return_val_if_fail(folder != NULL, NULL);
-       return folder->trash;
+       for (flist = folder_list; flist != NULL; flist = g_list_next(flist)) {
+               Folder * folder = FOLDER(flist->data);
+
+               if (folder == NULL)
+                       continue;
+               if (folder->trash == NULL)
+                       continue;
+
+               return folder->trash;
+       }
+
+       return NULL;
 }
 
 #define CREATE_FOLDER_IF_NOT_EXIST(member, dir, type)          \