[geary/wip/765516-gtk-widget-conversation-viewer: 43/207] Minor code cleanup.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/765516-gtk-widget-conversation-viewer: 43/207] Minor code cleanup.
- Date: Tue, 4 Oct 2016 00:00:01 +0000 (UTC)
commit 6581e9fd590ae79c1c21092898ecee95eeb112db
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 493c3ec..a65a174 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>();
@@ -584,11 +584,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); });
@@ -603,9 +602,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]