aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/pop3
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-06-07 08:06:29 +0800
committerDan Winship <danw@src.gnome.org>2000-06-07 08:06:29 +0800
commit4d5427769cfec587d9b8f727bd57ac1a1d2ae340 (patch)
tree4298b8ea452be219ecce2d96a4bc927782cabc31 /camel/providers/pop3
parentecd4fe3af090f79f30dd9df18bc4c087c366157b (diff)
downloadgsoc2013-evolution-4d5427769cfec587d9b8f727bd57ac1a1d2ae340.tar
gsoc2013-evolution-4d5427769cfec587d9b8f727bd57ac1a1d2ae340.tar.gz
gsoc2013-evolution-4d5427769cfec587d9b8f727bd57ac1a1d2ae340.tar.bz2
gsoc2013-evolution-4d5427769cfec587d9b8f727bd57ac1a1d2ae340.tar.lz
gsoc2013-evolution-4d5427769cfec587d9b8f727bd57ac1a1d2ae340.tar.xz
gsoc2013-evolution-4d5427769cfec587d9b8f727bd57ac1a1d2ae340.tar.zst
gsoc2013-evolution-4d5427769cfec587d9b8f727bd57ac1a1d2ae340.zip
Remove exists, create, delete. A CamelFolder now always references an
* camel-folder.c: Remove exists, create, delete. A CamelFolder now always references an existing folder. Remove delete_messages too since it wasn't being used. Add a "create" flag to get_subfolder saying whether or not to create the subfolder if it doesn't yet exist. * camel-store.c (camel_store_get_folder): Add a "create" flag to say whether or not to create the folder if it doesn't yet exist. (camel_store_delete_folder): New method, moved from CamelFolder. (cache_folder, uncache_folder): Fix up a bit. (get_folder_name): Explain what this is for. * providers/mbox/camel-mbox-folder.c: * providers/mbox/camel-mbox-store.c: Update. Remove support for hierarchical folders to simplify this for now, since we're not using it, and it's not completely clear how they should work in an ELocalStorage world. Needs to be revisited. * providers/pop3/camel-pop3-folder.c (delete_messages): Remove. * providers/pop3/camel-pop3-store.c (get_folder): Update. * providers/vee/camel-vee-folder.c (exists): Remove. * providers/vee/camel-vee-store.c (vee_get_folder): Update. svn path=/trunk/; revision=3453
Diffstat (limited to 'camel/providers/pop3')
-rw-r--r--camel/providers/pop3/camel-pop3-folder.c28
-rw-r--r--camel/providers/pop3/camel-pop3-store.c6
2 files changed, 3 insertions, 31 deletions
diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c
index 396bbc04f6..7355bd048b 100644
--- a/camel/providers/pop3/camel-pop3-folder.c
+++ b/camel/providers/pop3/camel-pop3-folder.c
@@ -39,7 +39,6 @@ static void pop3_open (CamelFolder *folder, CamelFolderOpenMode mode,
CamelException *ex);
static void pop3_close (CamelFolder *folder, gboolean expunge,
CamelException *ex);
-static gboolean delete_messages (CamelFolder *folder, CamelException *ex);
static gint get_message_count (CamelFolder *folder, CamelException *ex);
static GPtrArray *get_uids (CamelFolder *folder, CamelException *ex);
@@ -61,7 +60,6 @@ camel_pop3_folder_class_init (CamelPop3FolderClass *camel_pop3_folder_class)
/* virtual method overload */
camel_folder_class->open = pop3_open;
camel_folder_class->close = pop3_close;
- camel_folder_class->delete_messages = delete_messages;
camel_folder_class->get_message_count = get_message_count;
camel_folder_class->get_uids = get_uids;
@@ -138,32 +136,6 @@ pop3_close (CamelFolder *folder, gboolean expunge, CamelException *ex)
parent_class->close (folder, expunge, ex);
}
-static gboolean
-delete_messages (CamelFolder *folder, CamelException *ex)
-{
- int msgs;
- gboolean status;
-
- msgs = get_message_count (folder, ex);
- if (camel_exception_get_id (ex) != CAMEL_EXCEPTION_NONE)
- return FALSE;
-
- status = TRUE;
- for (; msgs > 0; msgs--) {
- status = status &&
- (camel_pop3_command (CAMEL_POP3_STORE (folder->parent_store),
- NULL, "DELE %d", msgs) ==
- CAMEL_POP3_OK);
- }
-
- if (!status) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- "Unable to delete all messages.");
- }
-
- return status;
-}
-
static CamelMimeMessage *
get_message_by_uid (CamelFolder *folder, const char *uid, CamelException *ex)
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
index 813ab6eaf7..9607d6723f 100644
--- a/camel/providers/pop3/camel-pop3-store.c
+++ b/camel/providers/pop3/camel-pop3-store.c
@@ -64,7 +64,7 @@ static GList *query_auth_types (CamelService *service, CamelException *ex);
static void free_auth_types (CamelService *service, GList *authtypes);
static CamelFolder *get_folder (CamelStore *store, const char *folder_name,
- CamelException *ex);
+ gboolean create, CamelException *ex);
static char *get_folder_name (CamelStore *store, const char *folder_name,
CamelException *ex);
static char *get_root_folder_name (CamelStore *store, CamelException *ex);
@@ -101,7 +101,6 @@ static void
camel_pop3_store_init (gpointer object, gpointer klass)
{
CamelService *service = CAMEL_SERVICE (object);
- CamelStore *store = CAMEL_STORE (object);
service->url_flags = ( CAMEL_SERVICE_URL_NEED_USER |
CAMEL_SERVICE_URL_NEED_HOST );
@@ -486,7 +485,8 @@ pop3_disconnect (CamelService *service, CamelException *ex)
}
static CamelFolder *
-get_folder (CamelStore *store, const char *folder_name, CamelException *ex)
+get_folder (CamelStore *store, const char *folder_name,
+ gboolean create, CamelException *ex)
{
return camel_pop3_folder_new (store, ex);
}