[evolution-rss] move folder selection to main loop
- From: Lucian Langa <lucilanga src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-rss] move folder selection to main loop
- Date: Tue, 19 Apr 2011 08:58:19 +0000 (UTC)
commit 36903b93349df927f69fffb14f066af9ee22ab8d
Author: Lucian Langa <lucilanga gnome org>
Date: Tue Apr 19 11:57:59 2011 +0300
move folder selection to main loop
src/parser.c | 18 ++----------------
src/parser.h | 6 ++++++
src/rss-image.c | 2 +-
src/rss.c | 21 ++++++++++++++++-----
4 files changed, 25 insertions(+), 22 deletions(-)
---
diff --git a/src/parser.c b/src/parser.c
index 3e6bdf8..d74c012 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -44,11 +44,6 @@ extern int rss_verbose_debug;
#include "misc.h"
#include "network-soup.h"
-typedef struct {
- RDF *r;
- GQueue *status_msg;
-} AsyncData;
-
extern GConfClient *rss_gconf;
void asyncr_context_free(AsyncData *asyncr);
GQueue *display_channel_items_sync(AsyncData *ayncr);
@@ -185,6 +180,7 @@ xml_parse_sux (const char *buf, int len)
g_return_val_if_fail (buf != NULL, NULL);
mime_type = g_content_type_guess(NULL, (guchar *)buf, len, NULL);
+ g_print("mime:%s\n", mime_type);
//feeding parsed anything other than xml results in blocking delays
//it's possible we can relax parser by using xmlErrorFunc
//UPDATE: add text/* - but exclude text/html I've seen huge delays because of this
@@ -1326,17 +1322,7 @@ done: farticle++;
refresh_mail_folder(mail_folder);
if (mail_folder) {
- if ((rf->import || feed_new)
- && (!rf->cancel && !rf->cancel_all && !rf->display_cancel)) {
- rss_select_folder(
- (gchar *)camel_folder_get_full_name(mail_folder));
- if (feed_new) feed_new = FALSE;
- }
-#if (DATASERVER_VERSION >= 2031001)
- g_object_unref(mail_folder);
-#else
- camel_object_unref(mail_folder);
-#endif
+ asyncr->mail_folder = mail_folder;
}
out: g_free(sender);
diff --git a/src/parser.h b/src/parser.h
index b52c9db..12d66c7 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -21,6 +21,12 @@
#include <mail/em-format-html.h>
+typedef struct {
+ RDF *r;
+ CamelFolder *mail_folder;
+ GQueue *status_msg;
+} AsyncData;
+
void display_channel_items (RDF *r,
gint io_priority,
GCancellable *cancellable,
diff --git a/src/rss-image.c b/src/rss-image.c
index 8af12e8..50e2119 100644
--- a/src/rss-image.c
+++ b/src/rss-image.c
@@ -435,7 +435,7 @@ display_folder_icon(GtkTreeStore *tree_store, gchar *key)
EMFolderTreeModel *mod = (EMFolderTreeModel *)tree_store;
struct _EMFolderTreeModelStoreInfo *si;
CamelStore *store = rss_component_peek_local_store();
- CamelFolderInfo *rssi;
+ CamelFolderInfo *rssi = NULL;
gint i=0, size;
gint *sizes;
diff --git a/src/rss.c b/src/rss.c
index 62466c7..6ae0218 100644
--- a/src/rss.c
+++ b/src/rss.c
@@ -3491,6 +3491,9 @@ generic_finish_feed(rfMessage *msg, gpointer user_data)
update_ttl(md5, r->ttl);
user_data = chn_name;
}
+ /*FIXME move this to display_doc feed display async because
+ * folder might not be there yet
+ */
if (g_hash_table_lookup(rf->hrdel_feed, lookup_key(user_data)))
get_feed_age(r, user_data);
}
@@ -5613,11 +5616,6 @@ process_feed(RDF *r)
return NULL;
}
-typedef struct {
- RDF *r;
- GQueue *status_msg;
-} AsyncData;
-
void
display_doc_finish (GObject *o, GAsyncResult *result, gpointer user_data);
@@ -5633,6 +5631,19 @@ display_doc_finish (GObject *o, GAsyncResult *result, gpointer user_data)
if (gconf_client_get_bool (client, GCONF_KEY_STATUS_ICON, NULL)) {
update_status_icon(asyncr->status_msg);
}
+ if (asyncr->mail_folder) {
+ if ((rf->import || feed_new)
+ && (!rf->cancel && !rf->cancel_all && !rf->display_cancel)) {
+ rss_select_folder(
+ (gchar *)camel_folder_get_full_name(asyncr->mail_folder));
+ if (feed_new) feed_new = FALSE;
+ }
+#if (DATASERVER_VERSION >= 2031001)
+ g_object_unref(asyncr->mail_folder);
+#else
+ camel_object_unref(asyncr->mail_folder);
+#endif
+ }
g_object_unref(client);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]