Skip to content

Commit

Permalink
Update add remove_proxy function
Browse files Browse the repository at this point in the history
  • Loading branch information
konkor committed Oct 26, 2019
1 parent 46b4d07 commit c67df2b
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,8 @@ const FrequencyIndicator = new Lang.Class({
return title_text;
},

add_event: function () {
if (this.proxy) {
if (event) this.proxy.disconnectSignal (event);
if (event_style) this.proxy.disconnectSignal (event_style);
delete this.proxy;
this.proxy = null;
event = 0;
event_style = 0;
}
add_event: function () {
this.remove_proxy ();
if (monitor_timeout > 0) {
if (!GLib.spawn_command_line_async (EXTENSIONDIR + "/cpufreq-service")) {
//error ("Unable to start cpufreq service...");
Expand All @@ -275,13 +268,19 @@ const FrequencyIndicator = new Lang.Class({
//else GLib.spawn_command_line_async ("killall cpufreq-service");
},

remove_events: function () {
remove_proxy: function () {
if (this.proxy) {
if (event) this.proxy.disconnectSignal (event);
if (event_style) this.proxy.disconnectSignal (event_style);
delete this.proxy;
this.proxy = null;
event = 0;
}
this.proxy = null;
event = 0;
event_style = 0;
},

remove_events: function () {
this.remove_proxy ();
if (settingsID) this.settings.disconnect (settingsID);
if (powerID) this.power.disconnect (powerID);
if (monitor_event) GLib.source_remove (monitor_event);
Expand Down

0 comments on commit c67df2b

Please sign in to comment.