camel_folder_create_folder can now return a heirachial tree so subscribe
2001-08-20 Jeffrey Stedfast <fejj@ximian.com> * component-factory.c (storage_create_folder): camel_folder_create_folder can now return a heirachial tree so subscribe to down the tree. svn path=/trunk/; revision=12257
This commit is contained in:

committed by
Jeffrey Stedfast

parent
fd2c106a51
commit
41dcb0c01b
@ -1,3 +1,9 @@
|
|||||||
|
2001-08-20 Jeffrey Stedfast <fejj@ximian.com>
|
||||||
|
|
||||||
|
* component-factory.c (storage_create_folder):
|
||||||
|
camel_folder_create_folder can now return a heirachial tree so
|
||||||
|
subscribe to down the tree.
|
||||||
|
|
||||||
2001-08-20 Damon Chaplin <damon@ximian.com>
|
2001-08-20 Damon Chaplin <damon@ximian.com>
|
||||||
|
|
||||||
* folder-browser-ui.c: use new Cut/Copy/Paste icons.
|
* folder-browser-ui.c: use new Cut/Copy/Paste icons.
|
||||||
|
@ -793,10 +793,10 @@ storage_create_folder (EvolutionStorage *storage,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
CamelStore *store = user_data;
|
CamelStore *store = user_data;
|
||||||
|
CamelFolderInfo *root, *fi;
|
||||||
char *prefix, *name;
|
char *prefix, *name;
|
||||||
CamelURL *url;
|
CamelURL *url;
|
||||||
CamelException ex;
|
CamelException ex;
|
||||||
CamelFolderInfo *fi;
|
|
||||||
|
|
||||||
if (strcmp (type, "mail") != 0)
|
if (strcmp (type, "mail") != 0)
|
||||||
return EVOLUTION_STORAGE_ERROR_UNSUPPORTED_TYPE;
|
return EVOLUTION_STORAGE_ERROR_UNSUPPORTED_TYPE;
|
||||||
@ -811,10 +811,10 @@ storage_create_folder (EvolutionStorage *storage,
|
|||||||
if (!url)
|
if (!url)
|
||||||
return EVOLUTION_STORAGE_ERROR_INVALID_URI;
|
return EVOLUTION_STORAGE_ERROR_INVALID_URI;
|
||||||
|
|
||||||
fi = camel_store_create_folder (store, url->path + 1, name, &ex);
|
root = camel_store_create_folder (store, url->path + 1, name, &ex);
|
||||||
camel_url_free (url);
|
camel_url_free (url);
|
||||||
} else
|
} else
|
||||||
fi = camel_store_create_folder (store, NULL, name, &ex);
|
root = camel_store_create_folder (store, NULL, name, &ex);
|
||||||
|
|
||||||
if (camel_exception_is_set (&ex)) {
|
if (camel_exception_is_set (&ex)) {
|
||||||
/* FIXME: do better than this */
|
/* FIXME: do better than this */
|
||||||
@ -822,14 +822,16 @@ storage_create_folder (EvolutionStorage *storage,
|
|||||||
return EVOLUTION_STORAGE_ERROR_INVALID_URI;
|
return EVOLUTION_STORAGE_ERROR_INVALID_URI;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (camel_store_supports_subscriptions (store))
|
if (camel_store_supports_subscriptions (store)) {
|
||||||
camel_store_subscribe_folder (store, fi->full_name, NULL);
|
for (fi = root; fi; fi = fi->child)
|
||||||
|
camel_store_subscribe_folder (store, fi->full_name, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
prefix = g_strndup (path, name - path - 1);
|
prefix = g_strndup (path, name - path - 1);
|
||||||
folder_created (store, prefix, fi);
|
folder_created (store, prefix, root);
|
||||||
g_free (prefix);
|
g_free (prefix);
|
||||||
|
|
||||||
camel_store_free_folder_info (store, fi);
|
camel_store_free_folder_info (store, root);
|
||||||
|
|
||||||
return EVOLUTION_STORAGE_OK;
|
return EVOLUTION_STORAGE_OK;
|
||||||
}
|
}
|
||||||
|
@ -2141,12 +2141,12 @@ create_folders (EvolutionStorage *storage, const char *prefix, CamelFolderInfo *
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
folder_created (CamelStore *store, const char *prefix, CamelFolderInfo *fi)
|
folder_created (CamelStore *store, const char *prefix, CamelFolderInfo *root)
|
||||||
{
|
{
|
||||||
EvolutionStorage *storage;
|
EvolutionStorage *storage;
|
||||||
|
|
||||||
if ((storage = mail_lookup_storage (store))) {
|
if ((storage = mail_lookup_storage (store))) {
|
||||||
create_folders (storage, prefix, fi);
|
create_folders (storage, prefix, root);
|
||||||
bonobo_object_unref (BONOBO_OBJECT (storage));
|
bonobo_object_unref (BONOBO_OBJECT (storage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user