Bug 624325 - CamelPOP3Store missing some methods
authorMatthew Barnes <mbarnes@redhat.com>
Tue, 13 Jul 2010 13:56:42 +0000 (09:56 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Tue, 13 Jul 2010 14:13:00 +0000 (10:13 -0400)
There's a corresponding change on the Evolution side to catch and clear
the CAMEL_STORE_ERROR_NO_FOLDER that CamelPOP3Store's get_folder_info()
method now sets to satisfy the new runtime checks.

camel/providers/pop3/camel-pop3-store.c

index 29e909d..2271d80 100644 (file)
@@ -678,6 +678,21 @@ pop3_store_query_auth_types (CamelService *service,
        return types;
 }
 
+static gchar *
+pop3_store_get_name (CamelService *service,
+                     gboolean brief)
+{
+       if (brief)
+               return g_strdup_printf (
+                       _("POP3 server %s"),
+                       service->url->host);
+       else
+               return g_strdup_printf (
+                       _("POP3 server for %s on %s"),
+                       service->url->user,
+                       service->url->host);
+}
+
 static CamelFolder *
 pop3_store_get_folder (CamelStore *store,
                        const gchar *folder_name,
@@ -703,6 +718,20 @@ pop3_store_get_trash (CamelStore *store,
        return NULL;
 }
 
+static CamelFolderInfo *
+pop3_store_get_folder_info (CamelStore *store,
+                            const gchar *top,
+                            guint32 flags,
+                            GError **error)
+{
+       g_set_error (
+               error, CAMEL_STORE_ERROR,
+               CAMEL_STORE_ERROR_NO_FOLDER,
+               _("POP3 stores have no folder hierarchy"));
+
+       return NULL;
+}
+
 static gboolean
 pop3_store_can_refresh_folder (CamelStore *store,
                                CamelFolderInfo *info,
@@ -726,10 +755,12 @@ camel_pop3_store_class_init (CamelPOP3StoreClass *class)
        service_class->connect = pop3_store_connect;
        service_class->disconnect = pop3_store_disconnect;
        service_class->query_auth_types = pop3_store_query_auth_types;
+       service_class->get_name = pop3_store_get_name;
 
        store_class = CAMEL_STORE_CLASS (class);
        store_class->get_folder = pop3_store_get_folder;
        store_class->get_trash = pop3_store_get_trash;
+       store_class->get_folder_info = pop3_store_get_folder_info;
        store_class->can_refresh_folder = pop3_store_can_refresh_folder;
 }