From 13cae5e1170d69ac347745711c92cf4c3f3583aa Mon Sep 17 00:00:00 2001 From: UshakovVasilii Date: Mon, 13 Apr 2015 21:04:38 +0300 Subject: [PATCH] UI optimization, #5 --- .../bumblebeeNvidiaUtil.js | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/freon@UshakovVasilii_Github.yahoo.com/bumblebeeNvidiaUtil.js b/freon@UshakovVasilii_Github.yahoo.com/bumblebeeNvidiaUtil.js index 106dd55..8902770 100644 --- a/freon@UshakovVasilii_Github.yahoo.com/bumblebeeNvidiaUtil.js +++ b/freon@UshakovVasilii_Github.yahoo.com/bumblebeeNvidiaUtil.js @@ -73,22 +73,21 @@ const BumblebeeNvidiaUtil = new Lang.Class({ get temp() { let key = 'bumblebee-nvidia' let label = this._label ? this._label : _('Bumblebee + NVIDIA'); - if(!this._active || !this._output) - return [{label: key, temp: null, displayName: label}]; - // GPU Current Temp : 37 C - for each(let line in this._output) { - if(!line) - continue; - let r; - if(line.indexOf('GPU Current Temp') > 0) - return [{ - label: key, - temp: (r = /[\s]*GPU Current Temp[\s]*:[\s]*(\d{1,3}).*/.exec(line)) ? parseFloat(r[1]) : null, - displayName: label - }]; + if(this._active && this._output){ + // GPU Current Temp : 37 C + for each(let line in this._output) { + if(!line) + continue; + let r; + if(line.indexOf('GPU Current Temp') > 0) + return [{ + label: key, + temp: (r = /[\s]*GPU Current Temp[\s]*:[\s]*(\d{1,3}).*/.exec(line)) ? parseFloat(r[1]) : null, + displayName: label + }]; + } } - - return []; + return [{label: key, temp: null, displayName: label}]; }, destroy: function(){