+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
/* Fall back */
store->status = CAMEL_DISCO_STORE_OFFLINE;
-
CAMEL_SERVICE_CLASS (parent_class)->cancel_connect (service);
}
{
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);
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)
{
CDS_CLASS (store)->set_status (store, status, ex);
}
-
static gboolean
can_work_offline (CamelDiscoStore *disco_store)
{
{
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
return path;
}
-
/**
* camel_service_get_path:
* @service: a #CamelService object
return info;
}
-
/**
* camel_store_summary_load:
* @summary: a #CamelStoreSummary object
* 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
**/
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);
#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)