[geary: 9/9] Fix the build for people who don't have libgee 0.20 installed.



commit 5f60b18876b951ce37283d84e31c72eceb190636
Author: Michael James Gratton <mike vee net>
Date:   Tue Mar 6 16:29:32 2018 +1100

    Fix the build for people who don't have libgee 0.20 installed.
    
    * src/engine/app/conversation-monitor/app-conversation-operation-queue.vala:
      Don't use Gee.Traversable.any_match, we can't depend on 0.20 yet.

 .../app-conversation-operation-queue.vala          |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/src/engine/app/conversation-monitor/app-conversation-operation-queue.vala 
b/src/engine/app/conversation-monitor/app-conversation-operation-queue.vala
index b250131..7d4cb8d 100644
--- a/src/engine/app/conversation-monitor/app-conversation-operation-queue.vala
+++ b/src/engine/app/conversation-monitor/app-conversation-operation-queue.vala
@@ -28,10 +28,20 @@ private class Geary.App.ConversationOperationQueue : BaseObject {
     }
 
     public void add(ConversationOperation op) {
-        Type op_type = op.get_type();
-        if (op.allow_duplicates ||
-            !this.mailbox.get_all().any_match(other => other.get_type() == op_type)) {
-            mailbox.send(op);
+        bool add_op = true;
+
+        if (!op.allow_duplicates) {
+            Type op_type = op.get_type();
+            foreach (ConversationOperation other in this.mailbox.get_all()) {
+                if (other.get_type() == op_type) {
+                    add_op = false;
+                    break;
+                }
+            }
+        }
+
+        if (add_op) {
+            this.mailbox.send(op);
         }
     }
 


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