Changed the semantics slightly. !FAST makes no guarantees about message
authorNot Zed <NotZed@Ximian.com>
Thu, 21 Jul 2005 04:03:10 +0000 (04:03 +0000)
committerMichael Zucci <zucchi@src.gnome.org>
Thu, 21 Jul 2005 04:03:10 +0000 (04:03 +0000)
2005-07-20  Not Zed  <NotZed@Ximian.com>

        * camel-store.c (camel_store_get_folder_info): Changed the
        semantics slightly.  !FAST makes no guarantees about message
        counts anymore.

        * camel-disco-store.c: fix up some stupid hidden logic here.

2005-07-19  Not Zed  <NotZed@Ximian.com>

        * camel-folder.c (camel_folder_refresh_info): remove the folder
        lock.

        * camel-disco-store.c (disco_get_folder_info): dont force a
        connect here, it doesn't belong here.

        * camel-store.c (camel_store_get_folder_info): remove subscription
        assert.

camel/ChangeLog
camel/camel-disco-store.c
camel/camel-folder.c
camel/camel-service.c
camel/camel-store-summary.c
camel/camel-store.c
camel/camel-store.h

index 40c29e9..b2d574b 100644 (file)
@@ -1,3 +1,22 @@
+2005-07-20  Not Zed  <NotZed@Ximian.com>
+
+       * camel-store.c (camel_store_get_folder_info): Changed the
+       semantics slightly.  !FAST makes no guarantees about message
+       counts anymore.
+
+       * camel-disco-store.c: fix up some stupid hidden logic here.
+
+2005-07-19  Not Zed  <NotZed@Ximian.com>
+
+       * camel-folder.c (camel_folder_refresh_info): remove the folder
+       lock.
+
+       * camel-disco-store.c (disco_get_folder_info): dont force a
+       connect here, it doesn't belong here.
+
+       * camel-store.c (camel_store_get_folder_info): remove subscription
+       assert.
+
 2005-07-13  Not Zed  <NotZed@Ximian.com>
 
        * camel-store.c (camel_store_init): initialise the mode to
index c602c1c..a7ff16f 100644 (file)
@@ -193,7 +193,6 @@ disco_cancel_connect (CamelService *service)
 
        /* Fall back */
        store->status = CAMEL_DISCO_STORE_OFFLINE;
-
        CAMEL_SERVICE_CLASS (parent_class)->cancel_connect (service);
 }
 
@@ -246,16 +245,6 @@ disco_get_folder_info (CamelStore *store, const char *top,
 {
        CamelDiscoStore *disco_store = CAMEL_DISCO_STORE (store);
 
-       /* Do this first so if we get forced offline, we'll switch to
-        * the correct branch below. (FIXME: This only works because
-        * we know that get_folder_info is the first call that the
-        * mailer makes on a store.)
-        */
-       if (CAMEL_SERVICE (store)->status == CAMEL_SERVICE_DISCONNECTED) {
-               if (!camel_service_connect (CAMEL_SERVICE (store), ex))
-                       return NULL;
-       }
-
        switch (camel_disco_store_status (disco_store)) {
        case CAMEL_DISCO_STORE_ONLINE:
                return CDS_CLASS (store)->get_folder_info_online (store, top, flags, ex);
@@ -292,15 +281,13 @@ camel_disco_store_status (CamelDiscoStore *store)
 
        g_return_val_if_fail (CAMEL_IS_DISCO_STORE (store), CAMEL_DISCO_STORE_ONLINE);
 
-       if (service->status == CAMEL_SERVICE_CONNECTING &&
-           store->status == CAMEL_DISCO_STORE_ONLINE &&
-           !camel_session_is_online (service->session))
+       if (store->status != CAMEL_DISCO_STORE_OFFLINE
+           && !camel_session_is_online (service->session))
                store->status = CAMEL_DISCO_STORE_OFFLINE;
 
        return store->status;
 }
 
-
 static void
 set_status(CamelDiscoStore *disco_store, CamelDiscoStoreStatus status, CamelException *ex)
 {
@@ -363,7 +350,6 @@ camel_disco_store_set_status (CamelDiscoStore *store,
        CDS_CLASS (store)->set_status (store, status, ex);
 }
 
-
 static gboolean
 can_work_offline (CamelDiscoStore *disco_store)
 {
index 94ee8c1..e26405f 100644 (file)
@@ -296,11 +296,7 @@ camel_folder_refresh_info (CamelFolder *folder, CamelException *ex)
 {
        g_return_if_fail (CAMEL_IS_FOLDER (folder));
 
-       CAMEL_FOLDER_LOCK(folder, lock);
-
        CF_CLASS (folder)->refresh_info (folder, ex);
-
-       CAMEL_FOLDER_UNLOCK(folder, lock);
 }
 
 static int
index dc7cbde..00f7458 100644 (file)
@@ -562,7 +562,6 @@ get_path (CamelService *service)
        return path;
 }              
 
-
 /**
  * camel_service_get_path:
  * @service: a #CamelService object
index 776c9cb..c0efe12 100644 (file)
@@ -349,7 +349,6 @@ camel_store_summary_path(CamelStoreSummary *s, const char *path)
        return info;
 }
 
-
 /**
  * camel_store_summary_load:
  * @summary: a #CamelStoreSummary object
index 55dc9f7..8b9f841 100644 (file)
@@ -750,17 +750,22 @@ dump_fi(CamelFolderInfo *fi, int depth)
  * This fetches information about the folder structure of @store,
  * starting with @top, and returns a tree of CamelFolderInfo
  * structures. If @flags includes #CAMEL_STORE_FOLDER_INFO_SUBSCRIBED,
- * only subscribed folders will be listed. (This flag can only be used
- * for stores that support subscriptions.) If @flags includes
+ * only subscribed folders will be listed.   If the store doesn't support
+ * subscriptions, then it will list all folders.  If @flags includes
  * #CAMEL_STORE_FOLDER_INFO_RECURSIVE, the returned tree will include
  * all levels of hierarchy below @top. If not, it will only include
  * the immediate subfolders of @top. If @flags includes
  * #CAMEL_STORE_FOLDER_INFO_FAST, the unread_message_count fields of
  * some or all of the structures may be set to %-1, if the store cannot
- * determine that information quickly. If @flags includes
+ * determine that information quickly.  If @flags includes
  * #CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL, don't include special virtual
  * folders (such as vTrash or vJunk).
  * 
+ * The CAMEL_STORE_FOLDER_INFO_FAST flag should be considered
+ * deprecated; most backends will behave the same whether it is
+ * supplied or not.  The only guaranteed way to get updated folder
+ * counts is to both open the folder and invoke refresh_info() it.
+ *
  * Returns a #CamelFolderInfo tree, which must be freed with
  * #camel_store_free_folder_info
  **/
@@ -770,9 +775,6 @@ camel_store_get_folder_info(CamelStore *store, const char *top, guint32 flags, C
        CamelFolderInfo *info;
        
        g_return_val_if_fail (CAMEL_IS_STORE (store), NULL);
-       g_return_val_if_fail ((store->flags & CAMEL_STORE_SUBSCRIPTIONS) ||
-                             !(flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED),
-                             NULL);
 
        info = CS_CLASS (store)->get_folder_info (store, top, flags, ex);
        
index 38ec24c..6bfe51d 100644 (file)
@@ -109,7 +109,6 @@ typedef struct _CamelRenameInfo {
 #define CAMEL_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_STORE_TYPE, CamelStoreClass))
 #define CAMEL_IS_STORE(o)    (CAMEL_CHECK_TYPE((o), CAMEL_STORE_TYPE))
 
-
 /* Flags for store flags */
 #define CAMEL_STORE_SUBSCRIPTIONS      (1 << 0)
 #define CAMEL_STORE_VTRASH             (1 << 1)