From 035bed49a25285e8ff3384c9cc782c6ce87da414 Mon Sep 17 00:00:00 2001 From: Erik van Pienbroek Date: Dec 11 2011 11:39:04 +0000 Subject: Various fixes including evo 3.2/3.4 support - The evolution plugin is now compatible with evolution 3.2 and 3.4 - Pack the list of evolution mail folders in a GtkScrolledWindow - Made the mailbox properties dialog resizable - Fixed a memory corruption issue in the tooltips code - RHBZ #682584: Use the GConf macros as mentioned at https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#GConf - Dropped ancient obsoletes tags and triggers - Dropped unneeded RPM tags --- diff --git a/mail-notification-5.4-evolution-3-0-support.patch b/mail-notification-5.4-evolution-3-0-support.patch index cfef509..988b381 100644 --- a/mail-notification-5.4-evolution-3-0-support.patch +++ b/mail-notification-5.4-evolution-3-0-support.patch @@ -66,7 +66,7 @@ } --- build/src/mn-evolution-server.c.orig 2011-02-09 00:17:38.850944227 +0100 +++ build/src/mn-evolution-server.c 2011-02-09 22:21:54.155346478 +0100 -@@ -496,11 +496,15 @@ +@@ -496,11 +422,23 @@ if (! folder) { @@ -75,7 +75,15 @@ - NULL, + static EMailSession * session = NULL; + if (!session) -+ session = e_mail_session_new(); ++ { ++#if EDS_CHECK_VERSION(3,1,0) ++ EShell *shell = e_shell_get_default(); ++ EShellBackend *shell_backend = e_shell_get_backend_by_name(shell, "mail"); ++ session = E_MAIL_SESSION(e_mail_backend_get_session(E_MAIL_BACKEND(shell_backend))); ++#else ++ session = e_mail_session_new(); ++#endif ++ } + + folder = e_mail_session_uri_to_folder_sync(session, uri, 0, NULL, NULL); +#else @@ -114,14 +122,135 @@ #else --- build/src/mn-evolution-folder-tree-server.c.orig 2011-06-17 22:01:49.226886994 +0200 +++ build/src/mn-evolution-folder-tree-server.c 2011-06-18 00:34:23.046889847 +0200 -@@ -444,7 +444,9 @@ +@@ -29,6 +29,12 @@ + #if !EDS_CHECK_VERSION(2,29,0) + #include + #endif ++#if EDS_CHECK_VERSION(3,1,0) ++#include ++#include ++#include ++#include ++#endif + #include + #include "mn-evolution-plugin.h" + #include "mn-evolution.h" +@@ -72,12 +78,17 @@ + #line 70 "mn-evolution-folder-tree-server.c" + #line 84 "src/mn-evolution-folder-tree-server.gob" + static void mn_evolution_folder_tree_server_plug_destroy_h (GtkObject * object, gpointer user_data); ++#if EDS_CHECK_VERSION(3,1,0) ++static void mn_evolution_folder_tree_server_selected_h (EMFolderTree * tree, CamelStore * store, const char * folder_name, guint32 flags, gpointer user_data); ++static void mn_evolution_folder_tree_server_activated_h (EMFolderTree * tree, CamelStore * store, const char * folder_name, gpointer user_data); ++#else + #line 73 "mn-evolution-folder-tree-server.c" + #line 104 "src/mn-evolution-folder-tree-server.gob" + static void mn_evolution_folder_tree_server_selected_h (EMFolderTree * tree, const char * full_name, const char * uri, guint32 flags, gpointer user_data); + #line 76 "mn-evolution-folder-tree-server.c" + #line 115 "src/mn-evolution-folder-tree-server.gob" + static void mn_evolution_folder_tree_server_activated_h (EMFolderTree * tree, const char * full_name, const char * uri, gpointer user_data); ++#endif + #line 79 "mn-evolution-folder-tree-server.c" + + /* +@@ -444,7 +455,13 @@ { #line 61 "src/mn-evolution-folder-tree-server.gob" -#if EDS_CHECK_VERSION(2,91,0) +#if EDS_CHECK_VERSION(3,1,0) -+ selfp->tree = em_folder_tree_new(NULL, NULL); ++ EShell *shell = e_shell_get_default(); ++ EShellBackend *shell_backend = e_shell_get_backend_by_name(shell, "mail"); ++ GtkWidget *browser = e_mail_browser_new (E_MAIL_BACKEND(shell_backend)); ++ EAlertSink *alert_sink = e_mail_reader_get_alert_sink(E_MAIL_READER(browser)); ++ selfp->tree = em_folder_tree_new(E_MAIL_BACKEND(shell_backend), alert_sink); +#elif EDS_CHECK_VERSION(2,91,0) selfp->session = e_mail_session_new(); selfp->tree = em_folder_tree_new(selfp->session); #elif EDS_CHECK_VERSION(2,29,0) +@@ -480,8 +497,11 @@ + #line 80 "src/mn-evolution-folder-tree-server.gob" + + #if EDS_CHECK_VERSION(2,91,0) +- g_object_unref(selfp->session); +- selfp->session = NULL; ++ if (selfp->session) ++ { ++ g_object_unref(selfp->session); ++ selfp->session = NULL; ++ } + #endif + g_signal_handlers_disconnect_by_func(selfp->plug, self_plug_destroy_h, self); + }} +@@ -516,6 +536,29 @@ + #line 503 "mn-evolution-folder-tree-server.c" + #undef __GOB_FUNCTION__ + ++#if EDS_CHECK_VERSION(3,1,0) ++static void ++mn_evolution_folder_tree_server_selected_h (EMFolderTree * tree, CamelStore * store, const char * folder_name, guint32 flags, gpointer user_data) ++{ ++ Self *self = user_data; ++ char *uri; ++ ++ if (!folder_name) return; ++ ++ uri = e_mail_folder_uri_build(store, folder_name); ++ self_folder_selected(self, uri); ++ g_free(uri); ++} ++ ++static void ++mn_evolution_folder_tree_server_activated_h (EMFolderTree * tree, CamelStore * store, const char * folder_name, gpointer user_data) ++{ ++ Self *self = user_data; ++ self_folder_activated(self); ++} ++ ++#else ++ + #line 104 "src/mn-evolution-folder-tree-server.gob" + static void + mn_evolution_folder_tree_server_selected_h (EMFolderTree * tree, const char * full_name, const char * uri, guint32 flags, gpointer user_data) +@@ -546,6 +589,8 @@ + #line 533 "mn-evolution-folder-tree-server.c" + #undef __GOB_FUNCTION__ + ++#endif ++ + #line 125 "src/mn-evolution-folder-tree-server.gob" + MNEvolutionFolderTreeServer * + mn_evolution_folder_tree_server_new (guint32 id) +--- build/src/mn-evolution-mailbox-properties.c.orig 2011-12-04 16:23:29.197007315 +0100 ++++ build/src/mn-evolution-mailbox-properties.c 2011-12-04 19:11:07.103199549 +0100 +@@ -165,12 +165,20 @@ + + MNMailboxProperties *properties = MN_MAILBOX_PROPERTIES(self); + GtkWidget *vbox; ++ GtkWidget *scrolled_window; + + /* translators: header capitalization */ + vbox = mn_mailbox_properties_add_general_section(properties, _("Folder")); + + selfp->tree = mn_evolution_folder_tree_client_new(); +- gtk_box_pack_start(GTK_BOX(vbox), selfp->tree, TRUE, TRUE, 0); ++ ++ scrolled_window = gtk_scrolled_window_new(NULL, NULL); ++ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); ++ gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window), selfp->tree); ++ ++ gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, TRUE, TRUE, 0); ++ ++ gtk_widget_show(scrolled_window); + gtk_widget_show(selfp->tree); + + g_object_connect(selfp->tree, +@@ -236,6 +244,8 @@ + if (client->proxy) + org_gnome_MailNotification_Evolution_get_folder_name(client->proxy, MN_EVOLUTION_FOLDER_TREE_CLIENT(selfp->tree)->selected_uri, &name, NULL); + ++ g_return_if_fail(name != NULL); ++ + g_free(selfp->name); + selfp->name = name; + diff --git a/mail-notification-5.4-gtk3-support.patch b/mail-notification-5.4-gtk3-support.patch index 6a29f86..02feada 100644 --- a/mail-notification-5.4-gtk3-support.patch +++ b/mail-notification-5.4-gtk3-support.patch @@ -93,15 +93,15 @@ #include #if !EDS_CHECK_VERSION(2,29,0) #include -@@ -71,7 +72,7 @@ +@@ -77,7 +78,7 @@ static void mn_evolution_folder_tree_server_finalize (MNEvolutionFolderTreeServer * self); #line 70 "mn-evolution-folder-tree-server.c" #line 84 "src/mn-evolution-folder-tree-server.gob" -static void mn_evolution_folder_tree_server_plug_destroy_h (GtkObject * object, gpointer user_data); +static void mn_evolution_folder_tree_server_plug_destroy_h (GtkWidget * object, gpointer user_data); - #line 73 "mn-evolution-folder-tree-server.c" - #line 104 "src/mn-evolution-folder-tree-server.gob" - static void mn_evolution_folder_tree_server_selected_h (EMFolderTree * tree, const char * full_name, const char * uri, guint32 flags, gpointer user_data); + #if EDS_CHECK_VERSION(3,1,0) + static void mn_evolution_folder_tree_server_selected_h (EMFolderTree * tree, CamelStore * store, const char * folder_name, guint32 flags, gpointer user_data); + static void mn_evolution_folder_tree_server_activated_h (EMFolderTree * tree, CamelStore * store, const char * folder_name, gpointer user_data); @@ -456,7 +457,7 @@ selfp->tree = em_folder_tree_new_with_model(model); #endif diff --git a/mail-notification-5.4-make-properties-dialog-resizable.patch b/mail-notification-5.4-make-properties-dialog-resizable.patch new file mode 100644 index 0000000..fafa6f2 --- /dev/null +++ b/mail-notification-5.4-make-properties-dialog-resizable.patch @@ -0,0 +1,11 @@ +--- build/src/mn-mailbox-properties-dialog.c.orig 2011-12-04 16:49:19.993956628 +0100 ++++ build/src/mn-mailbox-properties-dialog.c 2011-12-09 01:44:12.648751032 +0100 +@@ -407,7 +409,7 @@ + "delay_scale", &selfp->delay_scale, + NULL); + +- gtk_window_set_resizable(GTK_WINDOW(self), FALSE); ++ gtk_window_set_resizable(GTK_WINDOW(self), TRUE); + + if (selfp->dialog_parent) + gtk_window_set_transient_for(GTK_WINDOW(self), selfp->dialog_parent); diff --git a/mail-notification-5.4-prevent-memory-corruption-in-tooltips-code.patch b/mail-notification-5.4-prevent-memory-corruption-in-tooltips-code.patch new file mode 100644 index 0000000..308f060 --- /dev/null +++ b/mail-notification-5.4-prevent-memory-corruption-in-tooltips-code.patch @@ -0,0 +1,26 @@ +--- ./build/src/mn-tooltips.c.orig 2011-12-09 01:03:51.024311968 +0100 ++++ ./build/src/mn-tooltips.c 2011-12-09 01:09:32.540516561 +0100 +@@ -268,17 +268,22 @@ + { + #line 87 "src/mn-tooltips.gob" + ++ GSList *data_list_copy; + GSList *l; + + if (selfp->timeout_id) + g_source_remove(selfp->timeout_id); + +- MN_LIST_FOREACH(l, selfp->data_list) ++ /* Create a copy of the list to avoid memory corruption as the ++ * self_widget_remove call removes the item from selfp->data_list */ ++ data_list_copy = g_slist_copy(selfp->data_list); ++ MN_LIST_FOREACH(l, data_list_copy) + { + TooltipsData *data = l->data; + self_widget_remove(data->widget, data); + } + ++ g_slist_free(data_list_copy); + self_unset_window(self); + }} + #line 285 "mn-tooltips.c" diff --git a/mail-notification.spec b/mail-notification.spec index 81ef47f..a3600c6 100644 --- a/mail-notification.spec +++ b/mail-notification.spec @@ -1,6 +1,6 @@ Name: mail-notification Version: 5.4 -Release: 47%{?dist} +Release: 48%{?dist} Summary: Status icon that informs you if you have new mail Group: Applications/Internet @@ -21,7 +21,8 @@ Patch10: mail-notification-5.4-gtk3-support.patch Patch11: mail-notification-5.4-build-without-optimalisations.patch Patch12: mail-notification-5.4-add-fallback-icon.patch Patch13: popup-markup.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Patch14: mail-notification-5.4-make-properties-dialog-resizable.patch +Patch15: mail-notification-5.4-prevent-memory-corruption-in-tooltips-code.patch BuildRequires: gettext BuildRequires: desktop-file-utils, scrollkeeper @@ -43,8 +44,11 @@ BuildRequires: evolution-data-server-devel >= 1.5 # needed for the gtk-builder-convert tool BuildRequires: gtk2-devel +# needed for the GConf RPM macros +BuildRequires: GConf2 + # temporary to work-around some dependency issues in other packages... -BuildRequires: libICE-devel, libSM-devel +#BuildRequires: libICE-devel, libSM-devel Requires: hicolor-icon-theme @@ -102,6 +106,12 @@ Evolution support for Mail Notification. # Don't use tags as XFCE's notification daemon doesn't understand those %patch13 -p1 -b .span +# Make the mailbox properties dialog resizable +%patch14 -p0 -b .properties_resizable + +# Prevent memory corruption in the tooltips code +%patch15 -p0 -b .tooltips_mem_corruption + # Drop #line statements in C sources generated by .gob, # for the proper debuginfo package pushd build/src @@ -147,8 +157,6 @@ cat build/build.log %install -rm -rf $RPM_BUILD_ROOT - # For GConf apps: prevent schemas from being installed at this stage export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 @@ -184,22 +192,12 @@ popd %find_lang %{name} -%clean -rm -rf $RPM_BUILD_ROOT - - %pre -if [ "$1" -gt 1 ]; then - export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` - gconftool-2 --makefile-uninstall-rule \ - %{_sysconfdir}/gconf/schemas/%{name}.schemas >/dev/null || : -fi +%gconf_schema_prepare %{name} %post -export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` -/usr/bin/gconftool-2 --makefile-install-rule \ - %{_sysconfdir}/gconf/schemas/%{name}.schemas >/dev/null || : +%gconf_schema_upgrade %{name} /usr/bin/scrollkeeper-update -q -o %{_datadir}/omf/%{name} || : @@ -208,11 +206,7 @@ touch --no-create %{_datadir}/icons/hicolor || : %preun -if [ "$1" -eq 0 ]; then - export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` - gconftool-2 --makefile-uninstall-rule \ - %{_sysconfdir}/gconf/schemas/%{name}.schemas > /dev/null || : -fi +%gconf_schema_remove %{name} %postun @@ -222,15 +216,7 @@ touch --no-create %{_datadir}/icons/hicolor || : %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : -%triggerpostun -- %{name} < 5.0 -# Work-around for the broken preun scriptlets in some previous packages -export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` -/usr/bin/gconftool-2 --makefile-install-rule \ - %{_sysconfdir}/gconf/schemas/%{name}.schemas >/dev/null || : - - %files -f %{name}.lang -%defattr(-,root,root,-) %doc AUTHORS COPYING NEWS README TODO %{_sysconfdir}/gconf/schemas/mail-notification.schemas %{_bindir}/* @@ -244,11 +230,20 @@ export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` %files evolution-plugin -%defattr(-,root,root,-) %{_libdir}/evolution/*/plugins/* %changelog +* Sat Dec 12 2011 Erik van Pienbroek - 5.4-48 +- The evolution plugin is now compatible with evolution 3.2 and 3.4 +- Pack the list of evolution mail folders in a GtkScrolledWindow +- Made the mailbox properties dialog resizable +- Fixed a memory corruption issue in the tooltips code +- RHBZ #682584: Use the GConf macros as mentioned at + https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#GConf +- Dropped ancient obsoletes tags and triggers +- Dropped unneeded RPM tags + * Thu Nov 24 2011 Erik van Pienbroek - 5.4-47 - Fixed compatibility with latest evolution