From 224f26b84d9c12b0dd1d337f51c14b6ebb901007 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 4 Sep 2011 09:48:24 -0400 Subject: GtkApplication has some new EShell-like features. I pushed a few EShell features up to GtkApplication for GTK+ 3.2, so we can now trim off the redundancies in EShell. 1) GtkApplication has a new "window-added" signal which replaces EShell's own "window-created" signal. 2) GtkApplication has a new "window-removed" signal which replaces EShell's own "window-destroyed" signal. 3) gtk_application_get_windows() now returns a list of windows sorted by most recently focused, replacing e_shell_get_watched_windows(). 4) GtkApplication now provides enough hooks to subclasses that we can remove e_shell_watch_window() and call gtk_application_add_window() directly. --- plugins/mail-notification/mail-notification.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mail-notification/mail-notification.c b/plugins/mail-notification/mail-notification.c index d85987df55..d41f492292 100644 --- a/plugins/mail-notification/mail-notification.c +++ b/plugins/mail-notification/mail-notification.c @@ -308,11 +308,13 @@ notify_default_action_cb (NotifyNotification *notification, EShellWindow *shell_window; EShellSidebar *shell_sidebar; EMFolderTree *folder_tree; + GtkApplication *application; GtkAction *action; GList *list; shell = e_shell_get_default (); - list = e_shell_get_watched_windows (shell); + application = GTK_APPLICATION (shell); + list = gtk_application_get_windows (application); /* Find the first EShellWindow in the list. */ while (list != NULL && !E_IS_SHELL_WINDOW (list->data)) -- cgit v1.2.3 From d79ca40b62e72b1ec516631bbffabd6e2cad15e6 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 6 Oct 2011 16:59:04 +0200 Subject: Adapt to CamelFolderSummary API changes --- plugins/itip-formatter/itip-formatter.c | 47 ++++++++++++++------------------- 1 file changed, 20 insertions(+), 27 deletions(-) (limited to 'plugins') diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index 9ab5895c3d..5c733b7d49 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -2315,51 +2315,44 @@ view_response_cb (GtkWidget *widget, CamelFolderChangeInfo *changes = NULL; const gchar *tag = NULL; CamelMessageInfo *mi; - mi = camel_folder_summary_uid (pitip->folder->summary, pitip->uid); + mi = camel_folder_summary_get (pitip->folder->summary, pitip->uid); if (mi) { changes = camel_folder_change_info_new (); if (itip_view_get_recur_check_state (ITIP_VIEW (pitip->view))) { /* Recurring appointment and "apply-to-all" is selected */ - camel_message_info_ref (mi); tag = camel_message_info_user_tag (mi, "recurrence-key"); - camel_message_info_free (mi); if (tag) { - CamelStore *parent_store; - GList *list = NULL; - const gchar *full_name; - gint i = 0, count; - - count = camel_folder_summary_count (pitip->folder->summary); - for (i = 0; i < count; i++) { - mi = camel_folder_summary_index (pitip->folder->summary, i); - if (!mi) + gint i; + GPtrArray *known_uids; + + known_uids = camel_folder_summary_get_array (pitip->folder->summary); + for (i = 0; known_uids && i < known_uids->len; i++) { + const gchar *uid = g_ptr_array_index (known_uids, i); + CamelMessageInfo *mi2; + + mi2 = camel_folder_summary_get (pitip->folder->summary, uid); + if (!mi2) continue; - camel_message_info_ref (mi); - if ( camel_message_info_user_tag (mi, "recurrence-key") && g_str_equal (camel_message_info_user_tag (mi, "recurrence-key"), tag)) { - camel_folder_summary_remove_uid_fast (pitip->folder->summary, (gchar *)(mi->uid)); - camel_folder_change_info_remove_uid (changes, (gchar *) mi->uid); - list = g_list_prepend (list, (gpointer) mi->uid); - - /* step back once to have the right index */ - count--; - i--; + + if (camel_message_info_user_tag (mi2, "recurrence-key") && + g_str_equal (camel_message_info_user_tag (mi2, "recurrence-key"), tag)) { + camel_folder_summary_remove_uid (pitip->folder->summary, mi2->uid); + camel_folder_change_info_remove_uid (changes, mi2->uid); } - camel_message_info_free (mi); - } - full_name = camel_folder_get_full_name (pitip->folder); - parent_store = camel_folder_get_parent_store (pitip->folder); - camel_db_delete_uids (parent_store->cdb_w, full_name, list, NULL); - g_list_free (list); + camel_message_info_free (mi2); + } } } else { /* Either not a recurring appointment or "apply-to-all" is not selected. So just delete this instance alone */ camel_folder_summary_remove_uid (pitip->folder->summary, pitip->uid); camel_folder_change_info_remove_uid (changes, pitip->uid); } + camel_folder_changed (pitip->folder, changes); camel_folder_change_info_free (changes); + camel_message_info_free (mi); } } -- cgit v1.2.3