[gnome-characters] Fix spinner timeout handling



commit 317d4f657740462a5812ed309dc3527a843f7227
Author: Daiki Ueno <dueno src gnome org>
Date:   Mon Oct 6 14:10:36 2014 +0900

    Fix spinner timeout handling

 src/window.js |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/window.js b/src/window.js
index cfc443d..af00130 100644
--- a/src/window.js
+++ b/src/window.js
@@ -224,6 +224,7 @@ const MainView = new Lang.Class({
         let loadingBannerGrid = builder.get_object('loading-banner-grid');
         this._spinner = builder.get_object('loading-banner-spinner');
         this.add_named(loadingBannerGrid, 'loading-banner');
+        this._spinnerTimeoutId = 0;
 
         this._recentCharacters = [];
         this._cancellable = new Gio.Cancellable();
@@ -259,7 +260,6 @@ const MainView = new Lang.Class({
         this._spinnerTimeoutId =
             GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1000,
                              Lang.bind(this, function () {
-                                 this._spinnerTimeoutId = 0;
                                  this._spinner.start();
                                  this.visible_child_name = 'loading-banner';
                                  this.show_all();
@@ -269,6 +269,7 @@ const MainView = new Lang.Class({
     _finishSearch: function(name, result) {
         if (this._spinnerTimeoutId > 0) {
             GLib.source_remove(this._spinnerTimeoutId);
+            this._spinnerTimeoutId = 0;
             this._spinner.stop();
         }
 


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