aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog12
-rw-r--r--mail/folder-browser.c2
-rw-r--r--mail/mail-ops.c3
-rw-r--r--mail/mail-summary.c4
-rw-r--r--mail/mail-tools.c94
-rw-r--r--mail/mail-tools.h17
6 files changed, 14 insertions, 118 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index f0f6748eeb..41ffe07771 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,17 @@
2001-02-24 Jeffrey Stedfast <fejj@ximian.com>
+ * folder-browser.c: Toss the mail_tool_camel_lock* stuff.
+ * mail-ops.c: Same.
+ * mail-summary.c: Here too.
+
+ * mail-tools.c (mail_tool_uri_to_folder_noex): Blown away!
+ (mail_tool_filter_get_folder_func): *kapoosh*
+ (mail_tool_camel_lock_up): Same.
+ (mail_tool_camel_lock_down): Same.
+ (mail_tool_set_uid_flags): Don't need this rubbish anymore either.
+
+2001-02-24 Jeffrey Stedfast <fejj@ximian.com>
+
* component-factory.c (mail_load_storages): No longer need to
construct the vTrash here.
(owner_set_cb): Don't make the vTrash for the local store here.
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index 296a9ba30a..45cee5446e 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -618,7 +618,6 @@ hide_subject(GtkWidget *w, FolderBrowser *fb)
if (subject && subject[0]) {
expr = g_string_new("(match-all (header-contains \"subject\" ");
e_sexp_encode_string(expr, subject);
- mail_tool_camel_lock_down();
g_string_append(expr, "))");
message_list_hide_add(fb->message_list, expr->str, ML_HIDE_SAME, ML_HIDE_SAME);
g_string_free(expr, TRUE);
@@ -640,7 +639,6 @@ hide_sender(GtkWidget *w, FolderBrowser *fb)
if (camel_internet_address_get(from, 0, &real, &addr)) {
expr = g_string_new("(match-all (header-contains \"from\" ");
e_sexp_encode_string(expr, addr);
- mail_tool_camel_lock_down();
g_string_append(expr, "))");
message_list_hide_add(fb->message_list, expr->str, ML_HIDE_SAME, ML_HIDE_SAME);
g_string_free(expr, TRUE);
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 947bba4a9d..574cf6c387 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -45,9 +45,6 @@
#define d(x) x
-#define mail_tool_camel_lock_down()
-#define mail_tool_camel_lock_up()
-
FilterContext *
mail_load_filter_context(void)
{
diff --git a/mail/mail-summary.c b/mail/mail-summary.c
index bc04f19532..fb7b88ce8b 100644
--- a/mail/mail-summary.c
+++ b/mail/mail-summary.c
@@ -329,14 +329,12 @@ generate_folder_summaries (MailSummary *summary)
fs->name = g_strdup ("Inbox");
g_print ("%p: %s(%p)\n", fs, fs->name, fs->name);
fs->uri = NULL;
- mail_tool_camel_lock_up ();
ex = camel_exception_new ();
fs->folder = mail_tool_get_local_inbox (ex);
fs->total = camel_folder_get_message_count (fs->folder);
fs->unread = camel_folder_get_unread_message_count (fs->folder);
camel_exception_free (ex);
- mail_tool_camel_lock_down ();
camel_object_hook_event (CAMEL_OBJECT (fs->folder), "folder_changed",
(CamelObjectEventHookFunc) folder_changed_cb,
summary);
@@ -357,7 +355,6 @@ generate_folder_summaries (MailSummary *summary)
fs->name = g_strdup (rule->name);
uri = g_strconcat ("vfolder:", rule->name, NULL);
- mail_tool_camel_lock_up ();
fs->folder = vfolder_uri_to_folder (uri, ex);
fs->uri = g_strconcat ("evolution:/VFolders/", rule->name, NULL);
g_free (uri);
@@ -378,7 +375,6 @@ generate_folder_summaries (MailSummary *summary)
summary->numfolders++;
camel_exception_free (ex);
- mail_tool_camel_lock_down ();
}
gtk_object_destroy (GTK_OBJECT (context));
diff --git a/mail/mail-tools.c b/mail/mail-tools.c
index dcffb8ce50..73d024f8ff 100644
--- a/mail/mail-tools.c
+++ b/mail/mail-tools.c
@@ -49,47 +49,6 @@ static GPrivate *camel_locklevel = NULL;
#define LOCK_VAL (GPOINTER_TO_INT (g_private_get (camel_locklevel)))
#define LOCK_SET(val) g_private_set (camel_locklevel, (GINT_TO_POINTER (val)))
-void mail_tool_camel_lock_up (void)
-{
- return;
-
- G_LOCK (camel_locklevel);
-
- if (camel_locklevel == NULL)
- camel_locklevel = g_private_new (GINT_TO_POINTER (0));
-
- if (LOCK_VAL == 0) {
- G_UNLOCK (camel_locklevel);
- G_LOCK (camel);
- G_LOCK (camel_locklevel);
- }
-
- LOCK_SET (LOCK_VAL + 1);
-
- G_UNLOCK (camel_locklevel);
-}
-
-void mail_tool_camel_lock_down (void)
-{
- return;
-
- G_LOCK (camel_locklevel);
-
- if (camel_locklevel == NULL) {
- g_warning ("mail_tool_camel_lock_down: lock down before a lock up?");
- camel_locklevel = g_private_new (GINT_TO_POINTER (0));
- return;
- }
-
- LOCK_SET (LOCK_VAL - 1);
-
- if (LOCK_VAL == 0)
- G_UNLOCK (camel);
-
- G_UNLOCK (camel_locklevel);
-}
-
-/* **************************************** */
CamelFolder *
mail_tool_get_folder_from_urlname (const gchar *url, const gchar *name,
@@ -98,17 +57,12 @@ mail_tool_get_folder_from_urlname (const gchar *url, const gchar *name,
CamelStore *store;
CamelFolder *folder;
- mail_tool_camel_lock_up();
-
store = camel_session_get_store (session, url, ex);
- if (!store) {
- mail_tool_camel_lock_down();
+ if (!store)
return NULL;
- }
folder = camel_store_get_folder (store, name, flags, ex);
camel_object_unref (CAMEL_OBJECT (store));
- mail_tool_camel_lock_down();
return folder;
}
@@ -156,17 +110,12 @@ mail_tool_get_inbox (const gchar *url, CamelException *ex)
CamelStore *store;
CamelFolder *folder;
- mail_tool_camel_lock_up();
-
store = camel_session_get_store (session, url, ex);
- if (!store) {
- mail_tool_camel_lock_down();
+ if (!store)
return NULL;
- }
folder = camel_store_get_inbox (store, ex);
camel_object_unref (CAMEL_OBJECT (store));
- mail_tool_camel_lock_down();
return folder;
}
@@ -211,10 +160,7 @@ mail_tool_do_movemail (const gchar *source_url, CamelException *ex)
/* Movemail from source (source_url) to dest_path */
-
- mail_tool_camel_lock_up();
camel_movemail (source, dest_path, ex);
- mail_tool_camel_lock_down();
if (stat (dest_path, &sb) < 0 || sb.st_size == 0) {
g_free (dest_path);
@@ -232,9 +178,7 @@ mail_tool_do_movemail (const gchar *source_url, CamelException *ex)
void
mail_tool_set_uid_flags (CamelFolder *folder, const char *uid, guint32 mask, guint32 set)
{
- mail_tool_camel_lock_up ();
camel_folder_set_message_flags (folder, uid, mask, set);
- mail_tool_camel_lock_down ();
}
char *
@@ -295,12 +239,6 @@ mail_tool_make_message_attachment (CamelMimeMessage *message)
}
CamelFolder *
-mail_tool_filter_get_folder_func (CamelFilterDriver *d, const char *uri, void *data)
-{
- return mail_tool_uri_to_folder_noex (uri);
-}
-
-CamelFolder *
mail_tool_uri_to_folder (const char *uri, CamelException *ex)
{
CamelURL *url;
@@ -350,34 +288,6 @@ mail_tool_uri_to_folder (const char *uri, CamelException *ex)
return folder;
}
-CamelFolder *
-mail_tool_uri_to_folder_noex (const char *uri)
-{
- CamelException ex;
- CamelFolder *result;
-
- camel_exception_init (&ex);
- result = mail_tool_uri_to_folder (uri, &ex);
-
- if (camel_exception_is_set (&ex)) {
- gchar *msg;
- GtkWidget *dialog;
-
- msg = g_strdup_printf (_("Cannot open location `%s':\n"
- "%s"),
- uri,
- camel_exception_get_description (&ex));
- dialog = gnome_error_dialog (msg);
- g_free (msg);
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- }
-
- camel_exception_clear(&ex);
-
- return result;
-}
-
/**
* mail_tool_quote_message:
* @message: mime message to quote
diff --git a/mail/mail-tools.h b/mail/mail-tools.h
index 87fd6a5f79..7f6aa647f3 100644
--- a/mail/mail-tools.h
+++ b/mail/mail-tools.h
@@ -28,10 +28,6 @@
#include <camel/camel.h>
#include <camel/camel-filter-driver.h> /*eek*/
-/* A global recursive lock on Camel */
-void mail_tool_camel_lock_up (void);
-void mail_tool_camel_lock_down (void);
-
/* Get a CamelFolder from a root url and a foldername (uses the global session)*/
CamelFolder *
mail_tool_get_folder_from_urlname (const gchar *url, const gchar *name,
@@ -63,10 +59,6 @@ mail_tool_do_movemail (const gchar *source_url, CamelException *ex);
void
mail_tool_move_folder_contents (CamelFolder *source, CamelFolder *dest, gboolean use_cache, CamelException *ex);
-/* Sets the flags on a message represented by a UID in a folder. */
-void
-mail_tool_set_uid_flags (CamelFolder *folder, const char *uid, guint32 mask, guint32 set);
-
/* Generates the subject for a message forwarding @msg */
gchar *
mail_tool_generate_forward_subject (CamelMimeMessage *msg);
@@ -79,18 +71,9 @@ mail_tool_make_message_attachment (CamelMimeMessage *message);
CamelFolder *
mail_tool_uri_to_folder (const char *uri, CamelException *ex);
-/* Same as above taking no exceptions, popping up a GnomeErrorDialog
- * if any problems occur. */
-CamelFolder *
-mail_tool_uri_to_folder_noex (const char *uri);
-
GHashTable *
mail_lookup_url_table (CamelMimeMessage *mime_message);
-/* Appropriate for filter_driver_run */
-CamelFolder *
-mail_tool_filter_get_folder_func (CamelFilterDriver *d, const char *uri, void *data);
-
gchar *mail_tool_quote_message (CamelMimeMessage *message, const char *fmt, ...);
#endif