[geary/wip/730682-refine-convo-list] Minor ConversationList code cleanup.



commit cda82c97d4d7b0d84879a9155ac278cd4c67c373
Author: Michael James Gratton <mike vee net>
Date:   Wed Dec 27 00:41:39 2017 +1030

    Minor ConversationList code cleanup.

 .../conversation-list/conversation-list.vala       |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/client/conversation-list/conversation-list.vala 
b/src/client/conversation-list/conversation-list.vala
index 02139fc..0a8cc0b 100644
--- a/src/client/conversation-list/conversation-list.vala
+++ b/src/client/conversation-list/conversation-list.vala
@@ -230,9 +230,7 @@ public class ConversationList : Gtk.ListBox {
                 ConversationListItem? clicked =
                     get_row_at_y((int) event.y)  as ConversationListItem;
                 if (clicked != null) {
-                    ConversationListItem? selected =
-                        get_selected_row() as ConversationListItem;
-
+                    ConversationListItem? selected = get_selected_item();
                     if (selected == null) {
                         selected = get_item_at_index(0);
                     }
@@ -262,8 +260,7 @@ public class ConversationList : Gtk.ListBox {
             if (this.is_selection_mode_enabled) {
                 // Are (now) currently in selection mode, so
                 // toggle the row
-                ConversationListItem? row =
-                    get_selected_row() as ConversationListItem;
+                ConversationListItem? row = get_selected_item();
                 if (row != null) {
                     row.toggle_marked();
                 }
@@ -298,6 +295,10 @@ public class ConversationList : Gtk.ListBox {
         return get_row_at_index(index) as ConversationListItem;
     }
 
+    private inline ConversationListItem? get_selected_item() {
+        return get_selected_row() as ConversationListItem;
+    }
+
     private ConversationListItem? restore_selection() {
         ConversationListItem? row = null;
         if (this.selected_index >= 0) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]