[geary/mjog/info-bar-cleanup: 2/3] Components.InfoBarStack::remove_all: Don't update state if not needed



commit 2bc984e2da109f3e931f2d5bffd12550fac4c035
Author: Michael Gratton <mike vee net>
Date:   Fri Apr 3 09:28:51 2020 +1100

    Components.InfoBarStack::remove_all: Don't update state if not needed
    
    No point updating the wiget's state if there's nothing to remove.

 src/client/components/components-info-bar-stack.vala | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/client/components/components-info-bar-stack.vala 
b/src/client/components/components-info-bar-stack.vala
index bd91fbf0..2c5d896b 100644
--- a/src/client/components/components-info-bar-stack.vala
+++ b/src/client/components/components-info-bar-stack.vala
@@ -136,8 +136,10 @@ public class Components.InfoBarStack : Gtk.Frame, Geary.BaseInterface {
      * Removes all info bars from the stack, hiding the stack.
      */
     public new void remove_all() {
-        this.available.clear();
-        update();
+        if (!this.available.is_empty) {
+            this.available.clear();
+            update();
+        }
     }
 
     private void update() {


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