aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-01-23 02:47:01 +0800
committerDan Winship <danw@src.gnome.org>2001-01-23 02:47:01 +0800
commitbd1a57fc80b824adef52020b9b45b7810f1dad35 (patch)
treed936baf0a82e939faf4c4839a882828c07df048b
parentdb881ae0e321f66915a9dfb9aa5b3394c05a6c71 (diff)
downloadgsoc2013-evolution-bd1a57fc80b824adef52020b9b45b7810f1dad35.tar
gsoc2013-evolution-bd1a57fc80b824adef52020b9b45b7810f1dad35.tar.gz
gsoc2013-evolution-bd1a57fc80b824adef52020b9b45b7810f1dad35.tar.bz2
gsoc2013-evolution-bd1a57fc80b824adef52020b9b45b7810f1dad35.tar.lz
gsoc2013-evolution-bd1a57fc80b824adef52020b9b45b7810f1dad35.tar.xz
gsoc2013-evolution-bd1a57fc80b824adef52020b9b45b7810f1dad35.tar.zst
gsoc2013-evolution-bd1a57fc80b824adef52020b9b45b7810f1dad35.zip
Function to add a store/storage mapping. (add_storage): Use it.
* component-factory.c (mail_hash_storage): Function to add a store/storage mapping. (add_storage): Use it. * mail-vfolder.c (vfolder_uri_to_folder): Use the vfolder name rather than the string "mbox" (which wasn't ever used for anything) in the vfolder URL. (Combined with the CamelVeeFolder change, this makes camel_folder_get_name() return a pretty name for vfolders now.) Call mail_hash_storage() to record the CamelVeeStore/vfolder_storage mapping. (Ideally, there'd only be a single CamelVeeStore... this is just a quick hack.) vfolders now display their unread count once you've looked at them once. svn path=/trunk/; revision=7712
-rw-r--r--mail/ChangeLog17
-rw-r--r--mail/component-factory.c10
-rw-r--r--mail/mail-vfolder.c6
-rw-r--r--mail/mail.h3
4 files changed, 32 insertions, 4 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 070ddc4b49..9b89f23a3a 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,22 @@
2001-01-22 Dan Winship <danw@ximian.com>
+ * component-factory.c (mail_hash_storage): Function to add a
+ store/storage mapping.
+ (add_storage): Use it.
+
+ * mail-vfolder.c (vfolder_uri_to_folder): Use the vfolder name
+ rather than the string "mbox" (which wasn't ever used for
+ anything) in the vfolder URL. (Combined with the CamelVeeFolder
+ change, this makes camel_folder_get_name() return a pretty name
+ for vfolders now.) Call mail_hash_storage() to record the
+ CamelVeeStore/vfolder_storage mapping. (Ideally, there'd only be a
+ single CamelVeeStore... this is just a quick hack.)
+
+ vfolders now display their unread count once you've looked at them
+ once.
+
+2001-01-22 Dan Winship <danw@ximian.com>
+
* mail-tools.h: s/filter-driver.h/camel-filter-driver.h/ and
update first arg of mail_too_filter_get_folder_func
diff --git a/mail/component-factory.c b/mail/component-factory.c
index 6e2d4b69db..38a71b8596 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -315,8 +315,7 @@ add_storage (const char *name, const char *uri, CamelService *store,
switch (res) {
case EVOLUTION_STORAGE_OK:
- g_hash_table_insert (storages_hash, store, storage);
- camel_object_ref (CAMEL_OBJECT (store));
+ mail_hash_storage (store, storage);
mail_scan_subfolders (CAMEL_STORE (store), storage);
/* falllll */
case EVOLUTION_STORAGE_ERROR_ALREADYREGISTERED:
@@ -401,6 +400,13 @@ mail_load_storages (GNOME_Evolution_Shell shell, const GSList *sources, gboolean
}
}
+void
+mail_hash_storage (CamelService *store, EvolutionStorage *storage)
+{
+ camel_object_ref (CAMEL_OBJECT (store));
+ g_hash_table_insert (storages_hash, store, storage);
+}
+
EvolutionStorage*
mail_lookup_storage (CamelStore *store)
{
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c
index 64e92cd072..fb06a8479a 100644
--- a/mail/mail-vfolder.c
+++ b/mail/mail-vfolder.c
@@ -21,6 +21,7 @@
#include "mail-vfolder.h"
#include "mail-tools.h"
#include "mail-autofilter.h"
+#include "mail.h"
#include "camel/camel.h"
@@ -194,11 +195,14 @@ vfolder_uri_to_folder(const char *uri, CamelException *ex)
rule = (VfolderRule *)rule_context_find_rule((RuleContext *)context, info->name, NULL);
storeuri = g_strdup_printf("vfolder:%s/vfolder/%s", evolution_dir, info->name);
- foldername = g_strdup_printf("mbox?%s", info->query);
+ foldername = g_strdup_printf("%s?%s", info->name, info->query);
/* we dont have indexing on vfolders */
folder = mail_tool_get_folder_from_urlname (storeuri, foldername, CAMEL_STORE_FOLDER_CREATE, ex);
+ bonobo_object_ref (BONOBO_OBJECT (vfolder_storage));
+ mail_hash_storage ((CamelService *)folder->parent_store, vfolder_storage);
+
sourceuri = NULL;
sources = 0;
while ( (sourceuri = vfolder_rule_next_source(rule, sourceuri)) ) {
diff --git a/mail/mail.h b/mail/mail.h
index e23fbd2812..c80cabfa52 100644
--- a/mail/mail.h
+++ b/mail/mail.h
@@ -69,5 +69,6 @@ GtkWidget *mail_view_create (CamelFolder *source, const char *uid, CamelMimeMess
/* component factory for lack of a better place */
/*takes a GSList of MailConfigServices */
void mail_load_storages (GNOME_Evolution_Shell shell, const GSList *sources, gboolean is_account_data);
-/* used in the subscribe dialog code */
+
+void mail_hash_storage (CamelService *store, EvolutionStorage *storage);
EvolutionStorage *mail_lookup_storage (CamelStore *store);