[baobab] Clear the timeout id upon success



commit ac0c6b9870b5e5be00f6bc3efaf262a9c4290775
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Mar 2 12:00:17 2014 +0100

    Clear the timeout id upon success

 src/baobab-scanner.vala |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/baobab-scanner.vala b/src/baobab-scanner.vala
index 648f88f..403b9f0 100644
--- a/src/baobab-scanner.vala
+++ b/src/baobab-scanner.vala
@@ -388,7 +388,13 @@ namespace Baobab {
 
                 thread = new Thread<void*> ("scanner", scan_in_thread);
 
-                process_result_idle = Timeout.add (100, process_results);
+                process_result_idle = Timeout.add (100, () => {
+                        bool res = process_results();
+                        if (!res) {
+                            process_result_idle = 0;
+                        }
+                        return res;
+                    });
             } else {
                 completed ();
             }


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