diff options
-rw-r--r-- | camel/providers/pop3/camel-pop3-folder.c | 20 | ||||
-rw-r--r-- | camel/providers/pop3/camel-pop3-folder.h | 1 | ||||
-rw-r--r-- | camel/providers/pop3/camel-pop3-store.c | 11 |
3 files changed, 18 insertions, 14 deletions
diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c index f5dd28e596..e87cd97f4d 100644 --- a/camel/providers/pop3/camel-pop3-folder.c +++ b/camel/providers/pop3/camel-pop3-folder.c @@ -24,8 +24,12 @@ */ #include "camel-pop3-folder.h" +#include "camel-pop3-store.h" +#include "camel-exception.h" -#define CF_CLASS (o) (CAMEL_FOLDER_CLASS (GTK_OBJECT (o)->klass)) +#include <stdlib.h> + +#define CF_CLASS(o) (CAMEL_FOLDER_CLASS (GTK_OBJECT (o)->klass)) static gboolean has_message_number_capability (CamelFolder *folder); static CamelMimeMessage *get_message_by_number (CamelFolder *folder, @@ -96,7 +100,8 @@ camel_pop3_folder_get_type (void) CamelFolder *camel_pop3_folder_new (CamelStore *parent, CamelException *ex) { CamelFolder *folder = - CAMEL_FOLDER (gtk_object_new (camel_pop3_folder_get_type ())); + CAMEL_FOLDER (gtk_object_new (camel_pop3_folder_get_type (), + NULL)); CF_CLASS (folder)->init (folder, parent, NULL, "inbox", '/', ex); return folder; @@ -112,10 +117,10 @@ static CamelMimeMessage * get_message_by_number (CamelFolder *folder, gint number, CamelException *ex) { int status; - char *body; + char *result, *body; status = camel_pop3_command (CAMEL_POP3_STORE (folder->parent_store), - NULL, "RETR %d", number); + &result, "RETR %d", number); if (status != CAMEL_POP3_OK) { CamelService *service = CAMEL_SERVICE (folder->parent_store); camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, @@ -124,15 +129,16 @@ get_message_by_number (CamelFolder *folder, gint number, CamelException *ex) status == CAMEL_POP3_ERR ? result : "Unknown error"); g_free (result); - return -1; + return NULL; } + g_free (result); /* XXX finish this */ - return NULL + return NULL; } -static gint get_message_count (CamelFolder *folder, CamelException *ex); +static gint get_message_count (CamelFolder *folder, CamelException *ex) { int status, count; char *result; diff --git a/camel/providers/pop3/camel-pop3-folder.h b/camel/providers/pop3/camel-pop3-folder.h index eb62e23658..4199e30ead 100644 --- a/camel/providers/pop3/camel-pop3-folder.h +++ b/camel/providers/pop3/camel-pop3-folder.h @@ -35,7 +35,6 @@ extern "C" { #include <gtk/gtk.h> #include "camel-folder.h" -#include "camel-pop3-summary.h" #define CAMEL_POP3_FOLDER_TYPE (camel_pop3_folder_get_type ()) #define CAMEL_POP3_FOLDER(obj) (GTK_CHECK_CAST((obj), CAMEL_POP3_FOLDER_TYPE, CamelPop3Folder)) diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c index ece5171c2b..2d3f4cbb86 100644 --- a/camel/providers/pop3/camel-pop3-store.c +++ b/camel/providers/pop3/camel-pop3-store.c @@ -45,7 +45,7 @@ -static gboolean connect (CamelService *service, CamelException *ex); +static gboolean pop3_connect (CamelService *service, CamelException *ex); static CamelFolder *get_folder (CamelStore *store, const gchar *folder_name, CamelException *ex); @@ -59,7 +59,7 @@ camel_pop3_store_class_init (CamelPop3StoreClass *camel_pop3_store_class) CAMEL_STORE_CLASS (camel_pop3_store_class); /* virtual method overload */ - camel_service_class->connect = connect; + camel_service_class->connect = pop3_connect; camel_store_class->get_root_folder = camel_pop3_folder_new; camel_store_class->get_default_folder = camel_pop3_folder_new; @@ -107,7 +107,7 @@ camel_pop3_store_get_type (void) static gboolean -_connect (CamelService *service, CamelException *ex) +pop3_connect (CamelService *service, CamelException *ex) { struct hostent *h; struct sockaddr_in sin; @@ -221,8 +221,7 @@ camel_pop3_command (CamelPop3Store *store, char **ret, char *fmt, ...) CamelStreamBuffer *stream = store->stream; char *cmdbuf, *respbuf; va_list ap; - int status, i; - GPtrArray *data; + int status; va_start (ap, fmt); cmdbuf = g_strdup_vprintf (fmt, ap); @@ -246,7 +245,7 @@ camel_pop3_command (CamelPop3Store *store, char **ret, char *fmt, ...) if (status != CAMEL_POP3_FAIL) { *ret = strchr (respbuf, ' '); if (*ret) - *ret = g_strdup (ret + 1); + *ret = g_strdup (*ret + 1); } else *ret = NULL; } |