aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-vfolder.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2005-12-18 01:52:32 +0800
committerTor Lillqvist <tml@src.gnome.org>2005-12-18 01:52:32 +0800
commit88a30eea1d70a3cc1ec18c0f074cb2e997b874f6 (patch)
treebea260383a637e62f7eff50928a84b09d7565e92 /mail/mail-vfolder.c
parente8b060a9d4c63cee772403c04a4285e309bc5fd7 (diff)
downloadgsoc2013-evolution-88a30eea1d70a3cc1ec18c0f074cb2e997b874f6.tar
gsoc2013-evolution-88a30eea1d70a3cc1ec18c0f074cb2e997b874f6.tar.gz
gsoc2013-evolution-88a30eea1d70a3cc1ec18c0f074cb2e997b874f6.tar.bz2
gsoc2013-evolution-88a30eea1d70a3cc1ec18c0f074cb2e997b874f6.tar.lz
gsoc2013-evolution-88a30eea1d70a3cc1ec18c0f074cb2e997b874f6.tar.xz
gsoc2013-evolution-88a30eea1d70a3cc1ec18c0f074cb2e997b874f6.tar.zst
gsoc2013-evolution-88a30eea1d70a3cc1ec18c0f074cb2e997b874f6.zip
Harmonize #include order and syntax. Use pthread_equal() to compare
2005-12-17 Tor Lillqvist <tml@novell.com> * mail-vfolder.c: Harmonize #include order and syntax. Use pthread_equal() to compare pthread_t values. * mail-vfolder.c: Use gstdio wrappers. Construct XML file pathname at run-time. svn path=/trunk/; revision=30840
Diffstat (limited to 'mail/mail-vfolder.c')
-rw-r--r--mail/mail-vfolder.c44
1 files changed, 24 insertions, 20 deletions
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c
index 32411513c8..1f06bd121c 100644
--- a/mail/mail-vfolder.c
+++ b/mail/mail-vfolder.c
@@ -20,34 +20,34 @@
*
*/
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-#include <glib.h>
#include <string.h>
+
+#include <glib.h>
+
#include <libgnome/gnome-i18n.h>
-#include "mail-component.h"
-#include "mail-config.h"
-#include "mail-vfolder.h"
-#include "mail-tools.h"
-#include "mail-autofilter.h"
-#include "mail-folder-cache.h"
-#include "mail-ops.h"
-#include "mail-mt.h"
-#include "em-utils.h"
+#include <camel/camel-vee-folder.h>
+#include <camel/camel-vee-store.h>
+#include <camel/camel-vtrash-folder.h>
#include "e-util/e-account-list.h"
#include "e-util/e-error.h"
+#include "e-util/e-util-private.h"
-#include "camel/camel-vee-folder.h"
-#include "camel/camel-vee-store.h"
-#include "camel/camel-vtrash-folder.h"
-
+#include "em-utils.h"
#include "em-vfolder-context.h"
#include "em-vfolder-editor.h"
#include "em-vfolder-rule.h"
+#include "mail-autofilter.h"
+#include "mail-component.h"
+#include "mail-config.h"
+#include "mail-folder-cache.h"
+#include "mail-mt.h"
+#include "mail-ops.h"
+#include "mail-tools.h"
+#include "mail-vfolder.h"
#define d(x) /*(printf("%s(%d):%s: ", __FILE__, __LINE__, __PRETTY_FUNCTION__), (x))*/
@@ -447,7 +447,7 @@ mail_vfolder_add_uri(CamelStore *store, const char *curi, int remove)
return;
}
- g_assert(pthread_self() == mail_gui_thread);
+ g_assert(pthread_equal(pthread_self(), mail_gui_thread));
is_ignore = uri_is_ignore(store, curi);
@@ -542,7 +542,7 @@ mail_vfolder_delete_uri(CamelStore *store, const char *curi)
d(printf ("Deleting uri to check: %s\n", uri));
- g_assert (pthread_self() == mail_gui_thread);
+ g_assert (pthread_equal(pthread_self(), mail_gui_thread));
changed = g_string_new ("");
@@ -617,7 +617,7 @@ mail_vfolder_rename_uri(CamelStore *store, const char *cfrom, const char *cto)
if (context == NULL || uri_is_spethal(store, cfrom) || uri_is_spethal(store, cto))
return;
- g_assert(pthread_self() == mail_gui_thread);
+ g_assert(pthread_equal(pthread_self(), mail_gui_thread));
from = em_uri_from_camel(cfrom);
to = em_uri_from_camel(cto);
@@ -915,6 +915,7 @@ vfolder_load_storage(void)
{
char *user, *storeuri;
FilterRule *rule;
+ char *xmlfile;
vfolder_hash = g_hash_table_new(g_str_hash, g_str_equal);
@@ -939,10 +940,13 @@ vfolder_load_storage(void)
/* load our rules */
user = g_strdup_printf ("%s/mail/vfolders.xml", mail_component_peek_base_directory (mail_component_peek ()));
context = em_vfolder_context_new ();
+
+ xmlfile = g_build_filename (EVOLUTION_PRIVDATADIR, "vfoldertypes.xml", NULL);
if (rule_context_load ((RuleContext *)context,
- EVOLUTION_PRIVDATADIR "/vfoldertypes.xml", user) != 0) {
+ xmlfile, user) != 0) {
g_warning("cannot load vfolders: %s\n", ((RuleContext *)context)->error);
}
+ g_free (xmlfile);
g_free (user);
g_signal_connect(context, "rule_added", G_CALLBACK(context_rule_added), context);