properly fix with gtk3 and latest evolution

This commit is contained in:
jasper 2011-09-22 10:55:13 +00:00
parent b59c04f207
commit 0c239785b6
5 changed files with 341 additions and 70 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.5 2011/09/22 10:33:00 jasper Exp $
# $OpenBSD: Makefile,v 1.6 2011/09/22 10:55:13 jasper Exp $
SHARED_ONLY= Yes
@ -8,7 +8,7 @@ GNOME_PROJECT= evolution-rss
GNOME_VERSION= 0.2.90-20110621
PKGNAME= evolution-rss-${GNOME_VERSION:S/-/./}
REVISION= 4
REVISION= 5
CATEGORIES= mail

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-configure_ac,v 1.1 2011/09/22 10:55:13 jasper Exp $
From 5f8a0864469b0e778216b5ceb13a10caaa418990 Mon Sep 17 00:00:00 2001
From: Lucian Langa <lucilanga@gnome.org>
Date: Sat, 16 Jul 2011 12:57:01 +0000
Subject: Remove G_DISABLE_DEPRECATED.
--- configure.ac.orig Thu Sep 22 12:42:58 2011
+++ configure.ac Thu Sep 22 12:43:05 2011
@@ -14,7 +14,6 @@ AS_COMPILER_FLAGS(WARNING_FLAGS,
-DPANGO_DISABLE_DEPRECATED
-DGDK_PIXBUF_DISABLE_DEPRECATED
-DGDK_DISABLE_DEPRECATED
- -DGTK_DISABLE_DEPRECATED
-DG_DISABLE_SINGLE_INCLUDES
-DGTK_DISABLE_SINGLE_INCLUDES
-DGSEAL_ENABLE

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-src_parser_c,v 1.3 2011/09/22 10:55:13 jasper Exp $
From 62d6e9a7a68dc90abd244431afb47de9826cb423 Mon Sep 17 00:00:00 2001
From: Lucian Langa <lucilanga@gnome.org>
Date: Thu, 07 Jul 2011 20:34:45 +0000
Subject: Avoid camel_stream_printf().
--- src/parser.c.orig Sun Jun 19 17:27:29 2011
+++ src/parser.c Thu Sep 22 12:43:43 2011
@@ -185,7 +185,7 @@ xml_parse_sux (const char *buf, int len)
* application/ is often misdetected as text/html
*/
mime_type = g_content_type_guess(NULL, (guchar *)buf, 100, &uncertain);
- dp("mime:%s, uncertain:%d\n", mime_type, uncertain);
+ d("mime:%s, uncertain:%d\n", mime_type, uncertain);
//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

View File

@ -1,38 +1,36 @@
$OpenBSD: patch-src_rss-config-factory_c,v 1.3 2011/09/22 10:33:00 jasper Exp $
$OpenBSD: patch-src_rss-config-factory_c,v 1.4 2011/09/22 10:55:13 jasper Exp $
From 780e196eb0e7cbeda56413bfdb9654c83372eae3 Mon Sep 17 00:00:00 2001
From: Dominique Leuenberger <dimstar@opensuse.org>
Date: Mon, 22 Aug 2011 21:28:38 +0000
Subject: Bug 656126 - evolution-rss uses deprecated tk_[hv]box_new
From a7d886e3e383484ded07d9808eb8ada16ab1ca9c Mon Sep 17 00:00:00 2001
From: Lucian Langa <lucilanga@gnome.org>
Date: Thu, 11 Aug 2011 19:34:50 +0000
Subject: adapt to latest evolution changes
--- src/rss-config-factory.c.orig Sun Jun 19 17:27:29 2011
+++ src/rss-config-factory.c Thu Sep 22 12:25:07 2011
@@ -1488,7 +1488,8 @@ remove_feed_dialog(gchar *msg)
+++ src/rss-config-factory.c Thu Sep 22 12:46:44 2011
@@ -465,6 +465,9 @@ folder_cb (GtkWidget *widget, gpointer data)
GError *error = NULL;
EMFolderSelector *selector;
EMFolderTree *folder_tree;
+#if EVOLUTION_VERSION >= 30101
+ EMFolderTreeModel *model;
+#endif
#else
GtkWidget *folder_tree;
#endif
gtk_widget_show (dialog_vbox1);
@@ -482,10 +485,16 @@ folder_cb (GtkWidget *widget, gpointer data)
- vbox1 = gtk_vbox_new (FALSE, 10);
+ vbox1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
+
gtk_widget_show (vbox1);
gtk_box_pack_start (
GTK_BOX (dialog_vbox1),
@@ -2244,7 +2245,8 @@ decorate_import_fs (gpointer data)
gtk_file_filter_add_pattern (filter, "*.xml");
gtk_file_chooser_set_filter(data, filter);
window = e_mail_reader_get_window (reader);
- vbox1 = gtk_vbox_new (FALSE, 0);
+ vbox1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+
checkbutton1 = gtk_check_button_new_with_mnemonic (
_("Show article's summary"));
gtk_widget_show (checkbutton1);
@@ -3522,7 +3524,7 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
G_CALLBACK(start_check_cb),
(gpointer)GCONF_KEY_FEED_ICON);
- hbox = gtk_vbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start (
GTK_BOX (hbox),
+#if EVOLUTION_VERSION >= 30103
+ model = em_folder_tree_model_get_default ();
+#endif
dialog = em_folder_selector_new (
window,
#if EVOLUTION_VERSION >= 30101
backend,
+#if EVOLUTION_VERSION >= 30103
+ model,
+#endif
#else
EM_FOLDER_TREE (folder_tree),
#endif

View File

@ -1,41 +1,279 @@
$OpenBSD: patch-src_rss_c,v 1.3 2011/09/22 10:33:00 jasper Exp $
$OpenBSD: patch-src_rss_c,v 1.4 2011/09/22 10:55:13 jasper Exp $
From 780e196eb0e7cbeda56413bfdb9654c83372eae3 Mon Sep 17 00:00:00 2001
From: Dominique Leuenberger <dimstar@opensuse.org>
Date: Mon, 22 Aug 2011 21:28:38 +0000
Subject: Bug 656126 - evolution-rss uses deprecated tk_[hv]box_new
From 62d6e9a7a68dc90abd244431afb47de9826cb423 Mon Sep 17 00:00:00 2001
From: Lucian Langa <lucilanga@gnome.org>
Date: Thu, 07 Jul 2011 20:34:45 +0000
Subject: Avoid camel_stream_printf().
--- src/rss.c.orig Sun Jun 19 17:27:29 2011
+++ src/rss.c Thu Sep 22 12:25:51 2011
@@ -1387,11 +1387,7 @@ webkit_net_status (WebKitWebView *view,
if (resize_pane_hsize+14 > width && width != 1) {
gtk_widget_set_size_request(rf->mozembed,
-1, -1);
-#if GTK_MAJOR_VERSION < 3
- gtk_widget_size_request(rf->mozembed, &req);
-#else
gtk_widget_get_preferred_size(rf->mozembed, &req, NULL);
-#endif
+++ src/rss.c Thu Sep 22 12:43:43 2011
@@ -2174,6 +2174,7 @@ void org_gnome_cooly_format_rss(void *ep, EMFormatHook
GdkPixbuf *pix;
gchar *feed_dir, *feed_file, *iconfile;
gchar *tmp_path, *tmp_file;
+ gchar *str;
#if EVOLUTION_VERSION >= 22900 //kb//
GdkColor color;
#endif
@@ -2261,10 +2262,11 @@ void org_gnome_cooly_format_rss(void *ep, EMFormatHook
pobj->website = g_strstrip(g_strdup((gchar *)website));
pobj->stream = t->stream;
pobj->object.free = free_rss_controls;
- camel_stream_printf (
- t->stream,
+ str = g_strdup_printf (
"<object classid=%s></object>\n",
classid);
+ camel_stream_write_string (t->stream, str, NULL, NULL);
+ g_free(str);
g_free (classid);
if (req.width < resize_pane_hsize+14)
w = resize_pane_hsize-14;
@@ -1908,7 +1904,7 @@ org_gnome_rss_rfrcomm (EMFormatHTML *efh, void *eb,
{
struct _org_gnome_rss_controls_pobject *po =
(struct _org_gnome_rss_controls_pobject *) pobject;
- GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
+ GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
GtkWidget *button;
gchar *mem = g_strdup_printf("%s(%d):", _("Comments"), po->counter);
@@ -1931,8 +1927,8 @@ org_gnome_rss_controls (EMFormatHTML *efh, void *eb, E
{
struct _org_gnome_rss_controls_pobject *po =
(struct _org_gnome_rss_controls_pobject *) pobject;
- GtkWidget *vbox = gtk_vbox_new (TRUE, 1);
- GtkWidget *hbox2 = gtk_hbox_new (FALSE, 0);
+ GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 1);
+ GtkWidget *hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
GtkWidget *label3 = gtk_label_new ("");
GtkWidget *button, *button2, *button3, *button4, *button5;
gchar *mem = g_strdup_printf(" <b>%s: </b>", _("Feed view"));
@@ -2288,14 +2290,18 @@ void org_gnome_cooly_format_rss(void *ep, EMFormatHook
pobj->format = (EMFormatHTML *)t->format;
pobj->object.free = free_rss_browser;
pobj->part = t->part;
- camel_stream_printf(t->stream,
+ str = g_strdup_printf (
"<table style=\"border: solid #%06x 1px; background-color: #%06x; color: #%06x;\" cellpadding=1 cellspacing=0><tr><td align=center>",
frame_colour & 0xffffff,
frame_colour & 0xffffff,
text_colour & 0xffffff);
- camel_stream_printf (t->stream,
+ camel_stream_write_string (t->stream, str, NULL, NULL);
+ g_free (str);
+ str = g_strdup_printf (
"<object classid=%s></object></td></tr></table>",//</div>\n",
classid);
+ camel_stream_write_string (t->stream, str, NULL, NULL);
+ g_free (str);
g_free (classid);
goto out;
}
@@ -2306,16 +2312,17 @@ void org_gnome_cooly_format_rss(void *ep, EMFormatHook
//we do not need to setup a pop error menu since we're in
//formatting process. But instead display mail body an error
//such proxy error or transport error
- camel_stream_printf (t->stream,
+ str = g_strdup_printf (
"<div style=\"border: solid #%06x 1px; background-color: #%06x; color: #%06x;\">\n",
frame_colour & 0xffffff,
content_colour & 0xffffff,
text_colour & 0xffffff);
- camel_stream_printf(t->stream,
- "<div style=\"border: solid 0px; padding: 4px;\">\n");
- camel_stream_printf (t->stream, "<h3>Error!</h3>");
- camel_stream_printf (t->stream, "%s", err->message);
- camel_stream_printf (t->stream, "</div>");
+ camel_stream_write_string (t->stream, str, NULL, NULL);
+ g_free (str);
+ camel_stream_write_string (t->stream, "<div style=\"border: solid 0px; padding: 4px;\">\n", NULL, NULL);
+ camel_stream_write_string (t->stream, "<h3>Error!</h3>", NULL, NULL);
+ camel_stream_write_string (t->stream, err->message, NULL, NULL);
+ camel_stream_write_string (t->stream, "</div>", NULL, NULL);
goto out;
}
@@ -2329,30 +2336,39 @@ void org_gnome_cooly_format_rss(void *ep, EMFormatHook
} else
goto out;
- camel_stream_printf (fstream,
+ str = g_strdup_printf (
"<div style=\"border: solid #%06x 1px; background-color: #%06x; color: #%06x;\">\n",
frame_colour & 0xffffff,
content_colour & 0xffffff,
text_colour & 0xffffff);
- camel_stream_printf (fstream,
+ camel_stream_write_string (fstream, str, NULL, NULL);
+ g_free (str);
+ str = g_strdup_printf (
"<div style=\"border: solid 0px; background-color: #%06x; padding: 2px; color: #%06x;\">"
"<b><font size=+1><a href=%s>%s</a></font></b></div>",
content_colour & 0xEDECEB & 0xffffff,
text_colour & 0xffffff,
website, subject);
- if (category)
- camel_stream_printf(fstream,
+ camel_stream_write_string (fstream, str, NULL, NULL);
+ g_free (str);
+ if (category) {
+ str = g_strdup_printf (
"<div style=\"border: solid 0px; background-color: #%06x; padding: 2px; color: #%06x;\">"
"<b><font size=-1>%s: %s</font></b></div>",
content_colour & 0xEDECEB & 0xffffff, text_colour & 0xffffff,
_("Posted under"), category);
- camel_stream_printf (fstream,
+ camel_stream_write_string (fstream, str, NULL, NULL);
+ g_free (str);
+ }
+ str = g_strdup_printf (
"<div style=\"border: solid #%06x 0px; background-color: #%06x; padding: 2px; color: #%06x;\">"
"%s</div>",
frame_colour & 0xffffff,
content_colour & 0xffffff,
text_colour & 0xffffff,
buff);
+ camel_stream_write_string (fstream, str, NULL, NULL);
+ g_free (str);
g_string_free(content, 1);
} else {
@@ -2479,15 +2495,16 @@ pixdone: g_free(real_image);
feed_file = g_strdup(tmp_path);
#endif
- camel_stream_printf (
- fstream,
+ str = g_strdup_printf (
"<div style=\"border: solid #%06x 1px; background-color: #%06x; padding: 2px; color: #%06x;\">",
frame_colour & 0xffffff,
content_colour & 0xEDECEB & 0xffffff,
text_colour & 0xffffff);
+ camel_stream_write_string (fstream, str, NULL, NULL);
+ g_free (str);
if (g_file_test(tmp_path, G_FILE_TEST_EXISTS)){
if ((pixbuf = gdk_pixbuf_new_from_file(tmp_path, NULL))) {
- camel_stream_printf (fstream,
+ str = g_strdup_printf (
"<div style=\"border: solid 0px; background-color: #%06x; padding: 2px; color: #%06x;\">"
"<img height=16 src=%s>"
"<b><font size=+1><a href=%s>%s</a></font></b></div>",
@@ -2496,6 +2513,8 @@ pixdone: g_free(real_image);
feed_file,
website,
subject);
+ camel_stream_write_string (fstream, str, NULL, NULL);
+ g_free (str);
g_object_unref(pixbuf);
g_free(feed_file);
goto render_body;
@@ -2511,38 +2530,47 @@ pixdone: g_free(real_image);
iconfile = g_strdup(tmp_file);
#endif
g_free(tmp_file);
- camel_stream_printf (fstream,
+ str = g_strdup_printf (
"<div style=\"border: solid 0px; background-color: #%06x; padding: 2px; color: #%06x;\">"
"<img height=16 src=%s>"
"<b><font size=+1><a href=%s>%s</a></font></b></div>",
content_colour & 0xEDECEB & 0xffffff, text_colour & 0xffffff,
iconfile, website, subject);
+ camel_stream_write_string (fstream, str, NULL, NULL);
+ g_free (str);
g_free(iconfile);
g_free(feed_file);
-render_body: if (category)
- camel_stream_printf(fstream,
+render_body: if (category) {
+ str = g_strdup_printf (
"<div style=\"border: solid 0px; background-color: #%06x; padding: 2px; color: #%06x;\">"
"<b><font size=-1>Posted under: %s</font></b></div>",
content_colour & 0xEDECEB & 0xffffff,
text_colour & 0xffffff,
category);
- camel_stream_printf (fstream,
- "<div style=\"border: solid #%06x 0px; background-color: #%06x; padding: 10px; color: #%06x;\">"
- "%s</div>",
- frame_colour & 0xffffff,
- content_colour & 0xffffff,
- text_colour & 0xffffff,
- buff);
+ camel_stream_write_string (fstream, str, NULL, NULL);
+ g_free (str);
+ }
+ str = g_strdup_printf (
+ "<div style=\"border: solid #%06x 0px; background-color: #%06x; padding: 10px; color: #%06x;\">"
+ "%s</div>",
+ frame_colour & 0xffffff,
+ content_colour & 0xffffff,
+ text_colour & 0xffffff,
+ buff);
+ camel_stream_write_string (fstream, str, NULL, NULL);
+ g_free (str);
if (comments && gconf_client_get_bool (rss_gconf,
GCONF_KEY_SHOW_COMMENTS,
NULL)) {
if (commstream) {
- camel_stream_printf (fstream,
+ str = g_strdup_printf (
"<div style=\"border: solid #%06x 0px; background-color: #%06x; padding: 2px; color: #%06x;\">",
frame_colour & 0xffffff,
content_colour & 0xEDECEB & 0xffffff,
text_colour & 0xffffff);
+ camel_stream_write_string (fstream, str, NULL, NULL);
+ g_free (str);
result = print_comments(comments, commstream, (EMFormatHTML *)t->format);
g_free(commstream);
rfrclsid = g_strdup_printf ("org-gnome-rss-controls-%d",
@@ -2558,15 +2586,19 @@ render_body: if (category)
pobj->website = g_strdup(comments);
//this might not be needed but we want to make sure po->html is destroyed
pobj->object.free = free_rss_controls;
- camel_stream_printf(fstream,
+ str = g_strdup_printf (
"<object height=25 classid=%s></object>", rfrclsid);
+ camel_stream_write_string (fstream, str, NULL, NULL);
+ g_free (str);
if (result && strlen(result)) {
- camel_stream_printf(fstream,
+ str = g_strdup_printf (
"<div style=\"border: solid #%06x 0px; background-color: #%06x; padding: 10px; color: #%06x;\">%s",
frame_colour & 0xffffff,
content_colour & 0xffffff,
text_colour & 0xffffff,
result);
+ camel_stream_write_string (fstream, str, NULL, NULL);
+ g_free (str);
g_free(result);
}
g_free(rfrclsid);
@@ -2576,9 +2608,9 @@ render_body: if (category)
rf->hr, g_strstrip(feedid)));
fetch_comments(comments, g_strdup(uri), (EMFormatHTML *)t->format);
}
- camel_stream_printf (fstream, "</div>");
+ camel_stream_write_string (fstream, "</div>", NULL, NULL);
}
- camel_stream_printf (fstream, "</div>");
+ camel_stream_write_string (fstream, "</div>", NULL, NULL);
}
//this is required for proper charset rendering when html
@@ -2617,16 +2649,19 @@ out: if (addr)
g_free(addr);
return;
fmerror:
- camel_stream_printf (t->stream,
+ str = g_strdup_printf (
"<div style=\"border: solid #%06x 1px; background-color: #%06x; color: #%06x;\">\n",
frame_colour & 0xffffff, content_colour & 0xffffff, text_colour & 0xffffff);
- camel_stream_printf(t->stream,
- "<div style=\"border: solid 0px; padding: 4px;\">\n");
- camel_stream_printf (t->stream,
+ camel_stream_write_string (t->stream, str, NULL, NULL);
+ g_free (str);
+ camel_stream_write_string (t->stream,
+ "<div style=\"border: solid 0px; padding: 4px;\">\n",
+ NULL, NULL);
+ camel_stream_write_string (t->stream,
"<h3>Formatting error!</h3>"
- "Feed article corrupted! Cannot format article.");
- camel_stream_printf (t->stream,
- "</div></div>");
+ "Feed article corrupted! Cannot format article.",
+ NULL, NULL);
+ camel_stream_write_string (t->stream, "</div></div>", NULL, NULL);
return;
}
@@ -5139,7 +5174,7 @@ create_mail(create_feed *CF)
camel_content_type_unref (type);
stream = camel_stream_mem_new ();
// w/out an format argument this throws and seg fault
- camel_stream_printf (stream, "%s", CF->body);
+ camel_stream_write_string (stream, CF->body, NULL, NULL);
#if (DATASERVER_VERSION >= 2033001)
/*FIXME may block */
camel_data_wrapper_construct_from_stream_sync (rtext, stream, NULL, NULL);