Skip to content

Commit

Permalink
fix gjs errors #98
Browse files Browse the repository at this point in the history
  • Loading branch information
UshakovVasilii committed Sep 18, 2018
1 parent c8b27ac commit 5f2569c
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions freon@UshakovVasilii_Github.yahoo.com/aticonfigUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const GLib = imports.gi.GLib;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const CommandLineUtil = Me.imports.commandLineUtil;

const AticonfigUtil = new Lang.Class({
var AticonfigUtil = new Lang.Class({
Name: 'AticonfigUtil',
Extends: CommandLineUtil.CommandLineUtil,

Expand All @@ -23,7 +23,7 @@ const AticonfigUtil = new Lang.Class({
return [];
let label = null;
let temp = null;
for each(let line in this._output) {
for (let line of this._output) {
if(!line)
continue;
let r;
Expand Down
6 changes: 3 additions & 3 deletions freon@UshakovVasilii_Github.yahoo.com/bumblebeeNvidiaUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const Gio = imports.gi.Gio;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const CommandLineUtil = Me.imports.commandLineUtil;

const BumblebeeNvidiaUtil = new Lang.Class({
var BumblebeeNvidiaUtil = new Lang.Class({
Name: 'BumblebeeNvidiaUtil',
Extends: CommandLineUtil.CommandLineUtil,

Expand Down Expand Up @@ -49,7 +49,7 @@ const BumblebeeNvidiaUtil = new Lang.Class({
_detectLabel: function() {
// optirun nvidia-smi -L
// GPU 0: GeForce GT 525M (UUID: GPU-...)
for each(let line in GLib.spawn_command_line_sync(this._path + " nvidia-smi -L")){
for (let line of GLib.spawn_command_line_sync(this._path + " nvidia-smi -L")){
let match = /.*GPU [\d]:([\w\d\ ]+).*/.exec(line);
if(match){
this._label = match[1];
Expand Down Expand Up @@ -82,7 +82,7 @@ const BumblebeeNvidiaUtil = new Lang.Class({
let label = this._label ? this._label : _('Bumblebee + NVIDIA');
if(this._active && this._output){
// GPU Current Temp : 37 C
for each(let line in this._output) {
for (let line of this._output) {
if(!line)
continue;
let r;
Expand Down
2 changes: 1 addition & 1 deletion freon@UshakovVasilii_Github.yahoo.com/commandLineUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const Lang = imports.lang;
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;

const CommandLineUtil = new Lang.Class({
var CommandLineUtil = new Lang.Class({
Name: 'CommandLineUtil',

_init: function(){
Expand Down
34 changes: 17 additions & 17 deletions freon@UshakovVasilii_Github.yahoo.com/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const FreonItem = Me.imports.freonItem;
const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']);
const _ = Gettext.gettext;

const FreonMenuButton = new Lang.Class({
var FreonMenuButton = new Lang.Class({
Name: 'FreonMenuButton',
Extends: PanelMenu.Button,

Expand Down Expand Up @@ -54,7 +54,7 @@ const FreonMenuButton = new Lang.Class({
this._hotIcons = {};
let hotSensors = this._settings.get_strv('hot-sensors');
let showIcon = this._settings.get_boolean('show-icon-on-panel');
for each (let s in hotSensors){
for (let s of hotSensors){
this._createHotItem(s, showIcon);
}

Expand Down Expand Up @@ -225,13 +225,13 @@ const FreonMenuButton = new Lang.Class({
Mainloop.source_remove(this._timeoutId);
Mainloop.source_remove(this._updateUITimeoutId);

for each (let signal in this._settingChangedSignals){
for (let signal of this._settingChangedSignals){
this._settings.disconnect(signal);
};
},

_querySensors: function(){
for each (let sensor in this._utils) {
for (let sensor of Object.values(this._utils)) {
if (sensor.available) {
sensor.execute(Lang.bind(this,function(){
// we cannot change actor in background thread #74
Expand All @@ -242,7 +242,7 @@ const FreonMenuButton = new Lang.Class({

_updateUI: function(){
let needUpdate = false;
for each (let sensor in this._utils) {
for (let sensor of Object.values(this._utils)) {
if (sensor.available && sensor.updated) {
// global.log(sensor + ' updated');
sensor.updated = false;
Expand All @@ -257,7 +257,7 @@ const FreonMenuButton = new Lang.Class({

_fixNames: function(sensors){
let names = [];
for each (let s in sensors){
for (let s of sensors){
if(s.type == 'separator' ||
s.type == 'temperature-group' ||
s.type == 'temperature-average' ||
Expand Down Expand Up @@ -308,7 +308,7 @@ const FreonMenuButton = new Lang.Class({
let total = 0;
let sum = 0;
let max = 0;
for each (let i in tempInfo){
for (let i of tempInfo){
if(i.temp !== null){
total++;
sum += i.temp;
Expand All @@ -319,17 +319,17 @@ const FreonMenuButton = new Lang.Class({

let sensors = [];

for each (let i in gpuTempInfo){
for (let i of gpuTempInfo){
sensors.push({
type: 'gpu-temperature',
label: i.label,
value: this._formatTemp(i.temp),
displayName: i.displayName});
}
for each (let i in sensorsTempInfo){
for (let i of sensorsTempInfo){
sensors.push({type:'temperature', label: i.label, value:this._formatTemp(i.temp)});
}
for each (let i in driveTempInfo){
for (let i of driveTempInfo){
sensors.push({type:'drive-temperature', label: i.label, value:this._formatTemp(i.temp)});
}

Expand All @@ -352,7 +352,7 @@ const FreonMenuButton = new Lang.Class({

if(sensorsTempInfo.length > 0 && this._settings.get_boolean('group-temperature')){
sum = 0;
for each (let i in sensorsTempInfo){
for (let i of sensorsTempInfo){
sum += i.temp;
}
sensors.push({
Expand All @@ -361,7 +361,7 @@ const FreonMenuButton = new Lang.Class({
value: this._formatTemp(sum / sensorsTempInfo.length)});
}

for each (let fan in fanInfo){
for (let fan of fanInfo){
sensors.push({
type:'fan',
label:fan.label,
Expand All @@ -370,7 +370,7 @@ const FreonMenuButton = new Lang.Class({
if (fanInfo.length > 0 && voltageInfo.length > 0){
sensors.push({type : 'separator'});
}
for each (let voltage in voltageInfo){
for (let voltage of voltageInfo){
sensors.push({
type : 'voltage',
label:voltage.label,
Expand All @@ -380,15 +380,15 @@ const FreonMenuButton = new Lang.Class({

this._fixNames(sensors);

for each (let s in sensors)
for (let s of sensors)
if(s.type != 'separator') {
let l = this._hotLabels[s.key || s.label];
if(l)
l.set_text(s.value);
}

if(this._lastSensorsCount && this._lastSensorsCount==sensors.length){
for each (let s in sensors) {
for (let s of sensors) {
if(s.type != 'separator') {
let item = this._sensorMenuItems[s.key || s.label];
if(item) {
Expand Down Expand Up @@ -453,7 +453,7 @@ const FreonMenuButton = new Lang.Class({

if(needGroupVoltage){
let i = 0;
for each (let s in sensors)
for (let s of sensors)
if(s.type == 'voltage')
i++;
if(i < 2)
Expand All @@ -463,7 +463,7 @@ const FreonMenuButton = new Lang.Class({
let temperatureGroup = null;
let voltageGroup = null;

for each (let s in sensors){
for (let s of sensors){
if(s.type == 'separator'){
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
} else if (s.type == 'temperature-group') {
Expand Down
2 changes: 1 addition & 1 deletion freon@UshakovVasilii_Github.yahoo.com/freonItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const Lang = imports.lang;
const St = imports.gi.St;
const PopupMenu = imports.ui.popupMenu;

const FreonItem = new Lang.Class({
var FreonItem = new Lang.Class({
Name: 'FreonItem',
Extends: PopupMenu.PopupBaseMenuItem,

Expand Down
4 changes: 2 additions & 2 deletions freon@UshakovVasilii_Github.yahoo.com/hddtempUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const GLib = imports.gi.GLib;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const CommandLineUtil = Me.imports.commandLineUtil;

const HddtempUtil = new Lang.Class({
var HddtempUtil = new Lang.Class({
Name: 'HddtempUtil',
Extends: CommandLineUtil.CommandLineUtil,

Expand Down Expand Up @@ -67,7 +67,7 @@ const HddtempUtil = new Lang.Class({
}

let sensors = [];
for each(let line in hddtempOutput) {
for (let line of hddtempOutput) {
let fields = line.split(sep).filter(function(e){ return e; });
let sensor = { label: fields[1], temp: parseFloat(fields[2])};
//push only if the temp is a Number
Expand Down
2 changes: 1 addition & 1 deletion freon@UshakovVasilii_Github.yahoo.com/metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"shell-version": ["3.12", "3.14", "3.16", "3.18", "3.20", "3.22", "3.24", "3.26", "3.28"],
"shell-version": ["3.30"],
"uuid": "freon@UshakovVasilii_Github.yahoo.com",
"name": "Freon",
"description": "Shows CPU temperature, disk temperature, video card temperature (NVIDIA/Catalyst/Bumblebee&NVIDIA), voltage and fan RPM (forked from xtranophilist/gnome-shell-extension-sensors)",
Expand Down
4 changes: 2 additions & 2 deletions freon@UshakovVasilii_Github.yahoo.com/nvidiaUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const Gio = imports.gi.Gio;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const CommandLineUtil = Me.imports.commandLineUtil;

const NvidiaUtil = new Lang.Class({
var NvidiaUtil = new Lang.Class({
Name: 'NvidiaUtil',
Extends: CommandLineUtil.CommandLineUtil,

Expand Down Expand Up @@ -49,7 +49,7 @@ const NvidiaUtil = new Lang.Class({
if(!this._output)
return [];
let temps = [];
for each(let line in this._output) {
for (let line of this._output) {
if(!line)
continue;
temps.push(parseFloat(line));
Expand Down
2 changes: 1 addition & 1 deletion freon@UshakovVasilii_Github.yahoo.com/prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function init() {
Convenience.initTranslations();
}

const FreonPrefsWidget = new GObject.Class({
var FreonPrefsWidget = new GObject.Class({
Name: 'Freon.Prefs.Widget',
GTypeName: 'FreonPrefsWidget',
Extends: Gtk.Grid,
Expand Down
2 changes: 1 addition & 1 deletion freon@UshakovVasilii_Github.yahoo.com/sensorsUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const GLib = imports.gi.GLib;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const CommandLineUtil = Me.imports.commandLineUtil;

const SensorsUtil = new Lang.Class({
var SensorsUtil = new Lang.Class({
Name: 'SensorsUtil',
Extends: CommandLineUtil.CommandLineUtil,

Expand Down
4 changes: 2 additions & 2 deletions freon@UshakovVasilii_Github.yahoo.com/udisks2.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Async = {
}

// routines for handling of udisks2
const UDisks2 = new Lang.Class({
var UDisks2 = new Lang.Class({
Name: 'UDisks2',

_init: function(callback) {
Expand Down Expand Up @@ -110,7 +110,7 @@ const UDisks2 = new Lang.Class({
},

destroy: function(callback) {
for each (let proxy in this._udisksProxies){
for (let proxy of this._udisksProxies){
if(proxy.drive){
proxy.drive.run_dispose();
}
Expand Down

0 comments on commit 5f2569c

Please sign in to comment.