[evolution-rss] handle browser network error
- From: Lucian Langa <lucilanga src gnome org>
- To: svn-commits-list gnome org
- Subject: [evolution-rss] handle browser network error
- Date: Tue, 9 Jun 2009 16:25:00 -0400 (EDT)
commit 33f020f879f30efaaaa36cd5a7d20905eb9b1e4e
Author: Lucian Langa <lucilanga gnome org>
Date: Sun Jun 7 22:07:31 2009 +0300
handle browser network error
---
TODO | 20 --------------------
src/rss.c | 57 ++++++++++++---------------------------------------------
2 files changed, 12 insertions(+), 65 deletions(-)
diff --git a/TODO b/TODO
index e042fb6..67fcc95 100644
--- a/TODO
+++ b/TODO
@@ -1,12 +1,9 @@
* maybe implement md5 for uniqueing articles (for broken feeds)
* probably move to soup_unblocking when rendering of an article
- * when browsing a different feed/mail folder cancel all sessions
* also create groups when importing
- * create progress popup when render with an external engine (webkit/gecko)
* check webkit area sizing when using zoom in/out
* failback to old handler when formatting error
- * when deleting a folder offer to delete feed also
* jump to folder when adding through d-bus
* implement other engines besides soup
* implement USM (universal subscription mechanism)
@@ -20,30 +17,13 @@
* if necessary implement config code for evo 2.12
* fix recursivity on layer_find_pos
* fix annoying cursor jump when browsing through evo-rss folders
- * try harder to get feeds images (check by size 0) provide a expiration mechanism
* provide predefined groups of feeds (OSS & co)
* evolution import rss add no. of retries
* fix images when replying
* provide expire option for images
- * crash when no connection
-#11 0x00007f258ec191d0 in gtk_widget_set_parent ()
- from /usr/lib64/libgtk-x11-2.0.so.0
-#12 0x00007f258ea6096a in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
-#13 0x00007f25958569ee in e_task_widget_update_image (task_widget=0x3281e80,
- stock=<value optimized out>, text=0x34dcfb0 "Error fetching feed.")
- at e-task-widget.c:229
-#14 0x00007f2595833509 in e_activity_handler_make_error (
- activity_handler=0x226be20, component_id=<value optimized out>,
- error_type=<value optimized out>, error=0x2bd6160)
- at e-activity-handler.c:576
-#15 0x00007f257c9dec29 in rss_error (key=<value optimized out>,
- name=<value optimized out>, error=<value optimized out>,
- emsg=<value optimized out>) at rss.c:273
* slow delete operation on large folders
- * add icon to feed setup panel
* add handling parser error to setup_feed (check HIG for error msg)
* handle slash categories
- * hook update in the properties of folder
* use combo popup for moving and placement of feed folders
* trigger resync after folder rename and initial folder creation
* check webbuttons for webkit
diff --git a/src/rss.c b/src/rss.c
index 9ef2e30..3e3dcc7 100644
--- a/src/rss.c
+++ b/src/rss.c
@@ -1324,10 +1324,7 @@ reload_cb (GtkWidget *button, gpointer data)
void
mycall (GtkWidget *widget, GtkAllocation *event, gpointer data)
{
-// GtkAdjustment *a = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(widget));
-// g_print("page size:%d\n", a->page_size);
int width;
- GtkRequisition req;
struct _org_gnome_rss_controls_pobject *po = data;
guint k = rf->headers_mode ? 240 : 106;
@@ -1335,20 +1332,12 @@ mycall (GtkWidget *widget, GtkAllocation *event, gpointer data)
width = widget->allocation.width - 16 - 2;// - 16;
int height = widget->allocation.height - 16 - k;
d(g_print("resize webkit :width:%d, height: %d\n", width, height));
-// EMFormat *myf = (EMFormat *)efh;
-// GtkRequisition req;
-// gtk_widget_size_request(data, &req);
-// GtkWidget *my = data;
-// g_print("w:%d,h:%d\n", req.width, req.height);
-// g_print("w2:%d,h2:%d\n", my->allocation.width, my->allocation.height);
-// int wheight = height - (req.height - height) - 20;
-// height = req.height - 200;// - 16 - 194;
-//
- guint engine = fallback_engine();
if (po->mozembedwindow && rf->mozembed)
if(GTK_IS_WIDGET(po->mozembedwindow) && height > 0) {
if (!browser_fetching) {
- browser_write("Formatting...", 13, "file:///");
+ gchar *msg = g_strdup(_("Formatting..."));
+ browser_write(msg, strlen(msg), "file:///");
+ g_free(msg);
browser_fetching=1;
fetch_unblocking(
po->website,
@@ -1359,20 +1348,6 @@ mycall (GtkWidget *widget, GtkAllocation *event, gpointer data)
1,
NULL);
}
-/* gchar *str = content->str;
- gint len = strlen(content->str);
- while (len > 0) {
- if (len > 4096) {
- gtk_moz_embed_append_data(GTK_MOZ_EMBED(rf->mozembed),
- str, 4096);
- str+=4096;
- }
- else
- gtk_moz_embed_append_data(GTK_MOZ_EMBED(rf->mozembed),
- str, len);
- len-=4096;
- }
- gtk_moz_embed_close_stream(GTK_MOZ_EMBED(rf->mozembed));*/
gtk_widget_set_size_request((GtkWidget *)po->mozembedwindow, width, height);
// apparently resizing gtkmozembed widget won't redraw if using xulrunner
// there is no point in reload for the rest
@@ -1390,12 +1365,6 @@ void
rss_mozilla_init(void)
{
GError *err = NULL;
-/*#ifdef GECKO_HOME
- g_setenv("MOZILLA_FIVE_HOME", GECKO_HOME, 1);
-#endif
- g_unsetenv("MOZILLA_FIVE_HOME");*/
-
-
gecko_init();
}
#endif
@@ -2863,21 +2832,19 @@ finish_website (SoupSession *soup_sess, SoupMessage *msg, gpointer user_data)
{
g_return_if_fail(rf->mozembed);
GString *response = g_string_new_len(msg->response_body->data, msg->response_body->length);
- guint engine;
- engine = fallback_engine();
g_print("browser full:%d\n", (int)response->len);
g_print("browser fill:%d\n", (int)browser_fill);
- if (response->len)
- g_print("browser fill:%d%%\n", (int)((browser_fill*100)/response->len));
- gchar *str = (response->str);
- gint len = strlen(response->str);
- *str+= browser_fill;
- len-= browser_fill;
- g_print("len:%d\n", len);
- if (len>0) {
+ if (!response->len) {
+ gchar *msg = g_strdup(_("Formatting error."));
+ browser_write(msg, strlen(msg), "file://");
+ g_free(msg);
+ } else {
+ gchar *str = (response->str);
+ gint len = strlen(response->str);
+ *str+= browser_fill;
+ len-= browser_fill;
browser_write(str, len, user_data);
g_string_free(response, 1);
-// gtk_widget_show(rf->mozembed);
}
browser_fill = 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]