Fixes #471083 (bnc). Do not allow deletion of system folders.
authorChenthill Palanisamy <pchen@src.gnome.org>
Mon, 13 Apr 2009 08:44:56 +0000 (08:44 +0000)
committerChenthill Palanisamy <pchen@src.gnome.org>
Mon, 13 Apr 2009 08:44:56 +0000 (08:44 +0000)
svn path=/trunk/; revision=10207

camel/providers/groupwise/ChangeLog
camel/providers/groupwise/camel-groupwise-store.c

index ccc82ba..a1ba9cd 100644 (file)
@@ -1,3 +1,9 @@
+2009-04-13  Chenthill Palanisamy  <pchenthill@novell.com>
+
+       Fixes #471083 (bnc)
+       * camel/providers/groupwise/camel-groupwise-store.c: Sets the
+       System folder flag for system folders.
+
 2009-03-19  Chenthill Palanisamy  <pchenthill@novell.com>
 
        Fixes #477697
index 1b54358..aa7d18f 100644 (file)
@@ -485,7 +485,11 @@ groupwise_build_folder_info(CamelGroupwiseStore *gw_store, const char *parent_na
                fi->flags |= CAMEL_FOLDER_TYPE_TRASH;
        else if (!strcmp (folder_name, "Junk Mail"))
                fi->flags |= CAMEL_FOLDER_TYPE_JUNK;
-               
+
+       if (groupwise_is_system_folder (folder_name))
+               fi->flags |= CAMEL_FOLDER_SYSTEM;
+       
+
        fi->name = g_strdup(name);
        return fi;
 }
@@ -1303,6 +1307,12 @@ groupwise_delete_folder(CamelStore *store,
 
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
 
+       if (groupwise_is_system_folder (folder_name)) {
+               camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot delete GroupWise system folder '%s'"),
+                                     folder_name);
+               return;
+       }
+
        if (!camel_groupwise_store_connected (groupwise_store, ex)) {
                CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
                return;