[geary/wip/765516-gtk-widget-conversation-viewer: 17/112] Minor code cleanup.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/765516-gtk-widget-conversation-viewer: 17/112] Minor code cleanup.
- Date: Thu, 11 Aug 2016 14:43:05 +0000 (UTC)
commit 00ce3bc1a3d746e0c52dcdeaf8b72af9d5e27a4b
Author: Michael James Gratton <mike vee net>
Date: Tue Apr 12 01:15:38 2016 +1000
Minor code cleanup.
* src/client/components/main-window.vala (ComposerBox): Remove obsolete
theme CSS.
* src/client/conversation-viewer/conversation-viewer.vala
(ConversationViewer): Update some comments, re-organise some code.
.../conversation-viewer/conversation-viewer.vala | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-viewer.vala
b/src/client/conversation-viewer/conversation-viewer.vala
index c448c90..99fb743 100644
--- a/src/client/conversation-viewer/conversation-viewer.vala
+++ b/src/client/conversation-viewer/conversation-viewer.vala
@@ -106,11 +106,11 @@ public class ConversationViewer : Gtk.Stack {
[GtkChild]
private Gtk.Label user_message_label;
- // List of emails in this view.
+ // Sorted set of emails being displayed
private Gee.TreeSet<Geary.Email> messages { get; private set; default =
new Gee.TreeSet<Geary.Email>(Geary.Email.compare_sent_date_ascending); }
- // Maps emails to their corresponding ListBoxRow.
+ // Maps displayed emails to their corresponding ListBoxRow.
private Gee.HashMap<Geary.EmailIdentifier, Gtk.ListBoxRow> email_to_row = new
Gee.HashMap<Geary.EmailIdentifier, Gtk.ListBoxRow>();
@@ -583,11 +583,10 @@ public class ConversationViewer : Gtk.Stack {
}
private void add_message(Geary.Email email, bool is_in_folder) {
- // Ensure the message container is showing and the multi-message counter hidden.
- set_visible_child(conversation_page);
-
- if (messages.contains(email))
+ if (messages.contains(email)) {
return;
+ }
+ messages.add(email);
ConversationMessage message = new ConversationMessage(email, current_folder);
message.link_selected.connect((link) => { link_selected(link); });
@@ -602,9 +601,9 @@ public class ConversationViewer : Gtk.Stack {
row.get_style_context().add_class("frame");
row.show();
row.add(message);
+
conversation_listbox.add(row);
- messages.add(email);
email_to_row.set(email.id, row);
if (email.is_unread() == Geary.Trillian.TRUE) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]