[gnome-calculator] search-provider: cancel the current process on new calculation request



commit 882d2f5b98b402438989a386926613fe0822e73d
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Thu Aug 30 18:47:16 2018 +0200

    search-provider: cancel the current process on new calculation request
    
    As there's just one shell running at time, there's no point of supporting
    parallel calls, we can just safely refer to the last equation as the only one
    we need to compute.

 search-provider/search-provider.vala | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/search-provider/search-provider.vala b/search-provider/search-provider.vala
index df37b866..a3c57f76 100644
--- a/search-provider/search-provider.vala
+++ b/search-provider/search-provider.vala
@@ -86,6 +86,8 @@ public class SearchProvider : Object
             // "normalize" input to a format known to double.try_parse
             var equation = terms_to_equation (terms).replace (tsep_string, "").replace (decimal, ".");
 
+            cancel();
+
             // if the search is a plain number, don't process it
             if (double.try_parse (equation)) {
                 return false;


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