Translate name of Inbox and also set flags as torkel's previous fix.
authorJeffrey Stedfast <fejj@novell.com>
Tue, 15 Feb 2005 21:11:52 +0000 (21:11 +0000)
committerJeffrey Stedfast <fejj@src.gnome.org>
Tue, 15 Feb 2005 21:11:52 +0000 (21:11 +0000)
2005-02-14  Jeffrey Stedfast  <fejj@novell.com>

* camel-imap4-store-summary.c (store_info_to_folder_info):
Translate name of Inbox and also set flags as torkel's previous
fix.

* camel-imap4-store.c (imap4_build_folder_info): Translate the
name of Inbox.

camel/providers/imap4/ChangeLog
camel/providers/imap4/camel-imap4-store-summary.c
camel/providers/imap4/camel-imap4-store.c

index 3da6108..4cbaa54 100644 (file)
@@ -1,3 +1,17 @@
+2005-02-14  Jeffrey Stedfast  <fejj@novell.com>
+
+       * camel-imap4-store-summary.c (store_info_to_folder_info):
+       Translate name of Inbox and also set flags as torkel's previous
+       fix.
+
+       * camel-imap4-store.c (imap4_build_folder_info): Translate the
+       name of Inbox.
+
+2005-02-13  Björn Torkelsson  <torkel@acc.umu.se>
+
+       * camel-imap4-store.c (imap4_build_folder_info): Add flags if it
+       is inbox.
+
 2005-02-10  Jeffrey Stedfast  <fejj@novell.com>
 
        * camel-imap4-search.c (imap4_body_contains): If we're in offline
index 8ae6327..711f34b 100644 (file)
@@ -31,6 +31,7 @@
 #include <unistd.h>
 #include <errno.h>
 
+#include <camel/camel-i18n.h>
 #include <camel/camel-store.h>
 #include <camel/camel-file-utils.h>
 
@@ -352,15 +353,23 @@ static CamelFolderInfo *
 store_info_to_folder_info (CamelStoreSummary *s, CamelStoreInfo *si)
 {
        CamelFolderInfo *fi;
+       const char *name;
        
        fi = g_malloc0 (sizeof (CamelFolderInfo));
        fi->full_name = g_strdup (camel_store_info_path (s, si));
-       fi->name = g_strdup (camel_store_info_name (s, si));
        fi->uri = g_strdup (camel_store_info_uri (s, si));
        fi->flags = si->flags;
        fi->unread = si->unread;
        fi->total = si->total;
        
+       name = camel_store_info_name (s, si);
+       if (!g_ascii_strcasecmp (fi->full_name, "INBOX")) {
+               fi->flags |= CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_TYPE_INBOX;
+               fi->name = g_strdup (_("Inbox"));
+       } else {
+               fi->name = g_strdup (name);
+       }
+       
        return fi;
 }
 
index f61c6a2..c54946b 100644 (file)
@@ -1,6 +1,8 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*  Camel
- *  Copyright (C) 1999-2004 Jeffrey Stedfast
+/*
+ *  Authors: Jeffrey Stedfast <fejj@novell.com>
+ *
+ *  Copyright 2005 Novell, Inc. (www.novell.com)
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -15,6 +17,7 @@
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ *
  */
 
 
@@ -1242,6 +1245,9 @@ imap4_build_folder_info (CamelStore *store, const char *top, guint32 flags, GPtr
                fi->unread = -1;
                fi->total = -1;
                
+               if (!g_ascii_strcasecmp (fi->full_name, "INBOX"))
+                       fi->flags |= CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_TYPE_INBOX;
+               
                /* SELECTED folder, just get it from the folder */
                if (folder && !strcmp (folder->full_name, fi->full_name)) {
                        camel_object_get (folder, NULL, CAMEL_FOLDER_TOTAL, &fi->total, CAMEL_FOLDER_UNREAD, &fi->unread, 0);
@@ -1252,12 +1258,17 @@ imap4_build_folder_info (CamelStore *store, const char *top, guint32 flags, GPtr
                if (!(fi->flags & CAMEL_FOLDER_SUBSCRIBED))
                        imap4_subscription_info (store, fi);
                
-               g_free (list->name);
-               g_free (list);
-               
                array->pdata[i] = fi;
                
                camel_imap4_store_summary_note_info (((CamelIMAP4Store *) store)->summary, fi);
+               
+               if (!g_ascii_strcasecmp (fi->full_name, "INBOX")) {
+                       g_free (fi->name);
+                       fi->name = g_strdup (_("Inbox"));
+               }
+               
+               g_free (list->name);
+               g_free (list);
        }
        
        fi = camel_folder_info_build (array, top, '/', TRUE);