aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Leach <jleach@ximian.com>2001-08-14 05:36:41 +0800
committerJacob Leach <jleach@src.gnome.org>2001-08-14 05:36:41 +0800
commitdf8180e04abf2efd32ca0624484df5b35e564759 (patch)
tree036d3bf652af9ee351075751d552f3ff63bb63c9
parent074f38d92e739c53d0ac35f1f2f52b8c039eed84 (diff)
downloadgsoc2013-evolution-df8180e04abf2efd32ca0624484df5b35e564759.tar
gsoc2013-evolution-df8180e04abf2efd32ca0624484df5b35e564759.tar.gz
gsoc2013-evolution-df8180e04abf2efd32ca0624484df5b35e564759.tar.bz2
gsoc2013-evolution-df8180e04abf2efd32ca0624484df5b35e564759.tar.lz
gsoc2013-evolution-df8180e04abf2efd32ca0624484df5b35e564759.tar.xz
gsoc2013-evolution-df8180e04abf2efd32ca0624484df5b35e564759.tar.zst
gsoc2013-evolution-df8180e04abf2efd32ca0624484df5b35e564759.zip
Fix this so it can actually get folders from the hash of folders on the
2001-08-13 Jason Leach <jleach@ximian.com> * mail-local.c (get_folder): Fix this so it can actually get folders from the hash of folders on the local store (it was looking up plain @folder_name, which is typically "mbox", instead of the full URI, /home/jleach/evolution/local/Foo/mbox). * component-factory.c (do_remove_folder): Rename to remove_folder_done, more fitting for it's purpose. (do_xfer_folder): Similar name change. (do_create_folder): Similar name change. (remove_folder): Don't notifyResult for the component here, we will notify with our result in remove_folder_done. (xfer_folder): Ditto. * mail-vfolder.c (vfolder_refresh): Create new folders with unread counts of "0" instead of #FALSE (which just happens to be #defined as zero). svn path=/trunk/; revision=11964
-rw-r--r--mail/ChangeLog19
-rw-r--r--mail/component-factory.c18
-rw-r--r--mail/mail-local.c25
-rw-r--r--mail/mail-vfolder.c6
4 files changed, 45 insertions, 23 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 7a7492f765..7b0fa73dc9 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,22 @@
+2001-08-13 Jason Leach <jleach@ximian.com>
+
+ * mail-local.c (get_folder): Fix this so it can actually get
+ folders from the hash of folders on the local store (it was
+ looking up plain @folder_name, which is typically "mbox", instead
+ of the full URI, /home/jleach/evolution/local/Foo/mbox).
+
+ * component-factory.c (do_remove_folder): Rename to
+ remove_folder_done, more fitting for it's purpose.
+ (do_xfer_folder): Similar name change.
+ (do_create_folder): Similar name change.
+ (remove_folder): Don't notifyResult for the component here, we
+ will notify with our result in remove_folder_done.
+ (xfer_folder): Ditto.
+
+ * mail-vfolder.c (vfolder_refresh): Create new folders with unread
+ counts of "0" instead of #FALSE (which just happens to be #defined
+ as zero).
+
2001-08-13 Peter Williams <peterw@ximian.com>
* mail-send-recv.c (mail_autoreceive_setup): Break most of the
diff --git a/mail/component-factory.c b/mail/component-factory.c
index 0fd451be5f..c11706e628 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -171,7 +171,7 @@ create_view (EvolutionShellComponent *shell_component,
}
static void
-do_create_folder (char *uri, CamelFolder *folder, void *data)
+create_folder_done (char *uri, CamelFolder *folder, void *data)
{
GNOME_Evolution_ShellComponentListener listener = data;
CORBA_Environment ev;
@@ -204,7 +204,7 @@ create_folder (EvolutionShellComponent *shell_component,
looks silly but turns into a CamelURL that has
url->provider of "mbox" */
uri = g_strdup_printf ("mbox://%s", physical_uri);
- mail_create_folder (uri, do_create_folder, CORBA_Object_duplicate (listener, &ev));
+ mail_create_folder (uri, create_folder_done, CORBA_Object_duplicate (listener, &ev));
} else {
GNOME_Evolution_ShellComponentListener_notifyResult (
listener, GNOME_Evolution_ShellComponentListener_UNSUPPORTED_TYPE, &ev);
@@ -213,7 +213,7 @@ create_folder (EvolutionShellComponent *shell_component,
}
static void
-do_remove_folder (char *uri, gboolean removed, void *data)
+remove_folder_done (char *uri, gboolean removed, void *data)
{
GNOME_Evolution_ShellComponentListener listener = data;
GNOME_Evolution_ShellComponentListener_Result result;
@@ -248,15 +248,12 @@ remove_folder (EvolutionShellComponent *shell_component,
return;
}
- mail_remove_folder (physical_uri, do_remove_folder, CORBA_Object_duplicate (listener, &ev));
- GNOME_Evolution_ShellComponentListener_notifyResult (listener,
- GNOME_Evolution_ShellComponentListener_OK, &ev);
-
+ mail_remove_folder (physical_uri, remove_folder_done, CORBA_Object_duplicate (listener, &ev));
CORBA_exception_free (&ev);
}
static void
-do_xfer_folder (gboolean ok, void *data)
+xfer_folder_done (gboolean ok, void *data)
{
GNOME_Evolution_ShellComponentListener listener = data;
GNOME_Evolution_ShellComponentListener_Result result;
@@ -315,11 +312,8 @@ xfer_folder (EvolutionShellComponent *shell_component,
if (source) {
uids = camel_folder_get_uids (source);
mail_transfer_messages (source, uids, remove_source, destination_physical_uri,
- do_xfer_folder,
+ xfer_folder_done,
CORBA_Object_duplicate (listener, &ev));
-
- GNOME_Evolution_ShellComponentListener_notifyResult (listener, GNOME_Evolution_ShellComponentListener_OK,
- &ev);
} else
GNOME_Evolution_ShellComponentListener_notifyResult (listener, GNOME_Evolution_ShellComponentListener_INVALID_URI, &ev);
CORBA_exception_free (&ev);
diff --git a/mail/mail-local.c b/mail/mail-local.c
index 8602e4acb7..c3a5e5723f 100644
--- a/mail/mail-local.c
+++ b/mail/mail-local.c
@@ -310,23 +310,30 @@ mail_local_store_get_type (void)
}
static CamelFolder *
-get_folder (CamelStore *store, const char *folder_name,
- guint32 flags, CamelException *ex)
+get_folder (CamelStore *store,
+ const char *folder_name,
+ guint32 flags,
+ CamelException *ex)
{
MailLocalStore *local_store = (MailLocalStore *)store;
CamelFolder *folder;
MailLocalFolder *local_folder;
-
- local_folder = g_hash_table_lookup (local_store->folders, folder_name);
+ char *name;
+
+ name = g_strconcat (CAMEL_SERVICE (store)->url->path, folder_name, NULL);
+
+ local_folder = g_hash_table_lookup (local_store->folders, name);
+
if (local_folder) {
folder = local_folder->folder;
camel_object_ref (CAMEL_OBJECT (folder));
} else {
folder = NULL;
camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("No such folder %s"), folder_name);
+ _("No such folder %s"), name);
}
-
+
+ g_free (name);
return folder;
}
@@ -504,8 +511,10 @@ register_folder_registered(struct _mail_msg *mm)
if (local_folder->folder) {
gchar *name;
- g_hash_table_insert (local_folder->local_store->folders, local_folder->uri + 8,
+ g_hash_table_insert (local_folder->local_store->folders,
+ local_folder->uri + 8,
local_folder);
+
/* Remove the circular ref once the local store knows aboutthe folder */
camel_object_unref ((CamelObject *)local_folder->local_store);
@@ -555,7 +564,7 @@ local_storage_new_folder_cb (EvolutionStorageListener *storage_listener,
MailLocalFolder *local_folder;
struct _register_msg *m;
int id;
-
+
if (strcmp (folder->type, "mail") != 0 ||
strncmp (folder->physical_uri, "file://", 7) != 0 ||
strncmp (folder->physical_uri + 7, local_store->local_path,
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c
index b4382a33c7..4af918e64d 100644
--- a/mail/mail-vfolder.c
+++ b/mail/mail-vfolder.c
@@ -169,7 +169,7 @@ vfolder_refresh (void)
path = g_strdup_printf("/%s", info->name);
evolution_storage_removed_folder(vfolder_storage, path);
evolution_storage_new_folder(vfolder_storage, path, g_basename(path),
- "mail", uri, info->name, FALSE);
+ "mail", uri, info->name, 0);
g_free(uri);
g_free(path);
}
@@ -185,7 +185,7 @@ vfolder_refresh (void)
uri = g_strdup_printf("vfolder:%s", info->name);
path = g_strdup_printf("/%s", info->name);
evolution_storage_new_folder(vfolder_storage, path, g_basename(path),
- "mail", uri, info->name, FALSE);
+ "mail", uri, info->name, 0);
g_free(uri);
g_free(path);
}
@@ -221,7 +221,7 @@ vfolder_refresh (void)
uri = g_strdup_printf("vfolder:%s", info->name);
path = g_strdup_printf("/%s", info->name);
evolution_storage_new_folder(vfolder_storage, path, g_basename(path),
- "mail", uri, info->name, FALSE);
+ "mail", uri, info->name, 0);
g_free(uri);
g_free(path);
}