Skip to content

Commit 1025e6a

Browse files
committed
follow suggestion from extension.gnome.org review
1 parent 8b488a0 commit 1025e6a

File tree

1 file changed

+4
-30
lines changed

1 file changed

+4
-30
lines changed

extension.js

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const Main = imports.ui.main;
44
// const Tweener = imports.ui.tweener;
55
const Gio = imports.gi.Gio;
66
const GLib = imports.gi.GLib;
7+
const ByteArray = imports.byteArray;
78

89
const ExtensionUtils = imports.misc.extensionUtils;
910
const Me = ExtensionUtils.getCurrentExtension();
@@ -23,7 +24,6 @@ let resetNextCount = false, resetCount = 0;
2324

2425
function init() {
2526

26-
settings = Convenience.getSettings(PREFS_SCHEMA);
2727
}
2828

2929
function changeMode(widget, event) {
@@ -136,22 +136,6 @@ function parseStat() {
136136
ioSpeed.set_text(e.message);
137137
}
138138

139-
/*
140-
let curDiskstats = GLib.file_get_contents('/proc/diskstats');
141-
142-
if (diskstats == curDiskstats) {
143-
if (cur !== 0) {
144-
button.set_child(iconDark);
145-
cur = 0;
146-
}
147-
} else {
148-
if (cur != 1) {
149-
button.set_child(icon);
150-
cur = 1;
151-
}
152-
diskstats = curDiskstats;
153-
}*/
154-
155139
return GLib.SOURCE_CONTINUE;
156140
}
157141

@@ -189,6 +173,8 @@ function speedToString(amount) {
189173
}
190174

191175
function enable() {
176+
settings = Convenience.getSettings(PREFS_SCHEMA);
177+
192178
mode = settings.get_int('mode'); // default mode using bit (bps, kbps)
193179
fontmode = settings.get_int('fontmode');
194180

@@ -201,25 +187,12 @@ function enable() {
201187
track_hover: true
202188
});
203189

204-
/*
205-
icon = new St.Icon({
206-
gicon: Gio.icon_new_for_string(Me.path + "/icons/harddisk.svg")
207-
});
208-
iconDark = new St.Icon({
209-
gicon: Gio.icon_new_for_string(Me.path + "/icons/harddisk-dark.svg")
210-
});*/
211-
212190
ioSpeed = new St.Label({
213191
text: '---',
214192
y_align: Clutter.ActorAlign.CENTER,
215193
style_class: 'simplenetspeed-label'
216194
});
217195

218-
// ioSpeedStaticIcon = new St.Label({
219-
// text: '💾',
220-
// style_class: 'simplenetspeed-static-icon'
221-
// });
222-
223196
button.set_child(chooseLabel());
224197
button.connect('button-press-event', changeMode);
225198

@@ -234,5 +207,6 @@ function disable() {
234207
GLib.source_remove(timeout);
235208
timeout = null;
236209
Main.panel._rightBox.remove_child(button);
210+
button.destroy();
237211
}
238212
}

0 commit comments

Comments
 (0)