Hello community,

here is the log from the commit of package hamster-time-tracker for 
openSUSE:Factory checked in at 2019-05-12 11:43:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/hamster-time-tracker (Old)
 and      /work/SRC/openSUSE:Factory/.hamster-time-tracker.new.5148 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "hamster-time-tracker"

Sun May 12 11:43:44 2019 rev:2 rq:702005 version:unknown

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/hamster-time-tracker/hamster-time-tracker.changes    
    2019-03-26 15:43:17.892213873 +0100
+++ 
/work/SRC/openSUSE:Factory/.hamster-time-tracker.new.5148/hamster-time-tracker.changes
      2019-05-12 11:44:19.415792170 +0200
@@ -1,0 +2,18 @@
+Fri May 10 09:56:26 UTC 2019 - Martin Wilck <[email protected]>
+
+- Make hamster-shell-extension compatible with GNOME 3.32 for TW
+  (gh#projecthamster/hamster-shell-extension#312)
+  * added 0007-drop-convenience.js.patch
+  * added 0008-make-test-style-set-esversion-to-6-for-GNOME-3.32.patch
+  * added 0009-Mark-GNOME-3.32-as-supported-all-others-as-unsupport.patch
+  * added 0010-Port-GObject-classes-to-JS6-classes.patch
+  * added 0011-add-jshint-validthis-to-silence-warnings-about-stric.patch
+  * added 0012-todaysFactsWidget-add-missing-bind.patch
+  * added 0013-replace-Lang.bind-with-function-.bind.patch
+  * added 0014-Port-non-GObject-class-to-JS6.patch
+  * added 0015-extension.js-add-jshint-validthis-hints.patch
+  * added 0016-extension.js-fix-indentation-after-previous-change.patch
+  * added 0017-Don-t-log-ACTIVITIES-at-every-refresh.patch
+  * added 0018-doc-remove-broken-link-to-usejsdoc.org.patch
+
+-------------------------------------------------------------------

New:
----
  0007-drop-convenience.js.patch
  0008-make-test-style-set-esversion-to-6-for-GNOME-3.32.patch
  0009-Mark-GNOME-3.32-as-supported-all-others-as-unsupport.patch
  0010-Port-GObject-classes-to-JS6-classes.patch
  0011-add-jshint-validthis-to-silence-warnings-about-stric.patch
  0012-todaysFactsWidget-add-missing-bind.patch
  0013-replace-Lang.bind-with-function-.bind.patch
  0014-Port-non-GObject-class-to-JS6.patch
  0015-extension.js-add-jshint-validthis-hints.patch
  0016-extension.js-fix-indentation-after-previous-change.patch
  0017-Don-t-log-ACTIVITIES-at-every-refresh.patch
  0018-doc-remove-broken-link-to-usejsdoc.org.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ hamster-time-tracker.spec ++++++
--- /var/tmp/diff_new_pack.S1uMos/_old  2019-05-12 11:44:24.103805934 +0200
+++ /var/tmp/diff_new_pack.S1uMos/_new  2019-05-12 11:44:24.107805945 +0200
@@ -15,6 +15,7 @@
 # Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
+
 %global ext_version 0.10.0
 %global ext_uuid [email protected]
 %bcond_without extension
@@ -46,7 +47,18 @@
 Patch104:      0004-metadata.json-mark-GNOME-3.30-as-supported.patch
 Patch105:      0005-Makefile-allow-shipping-convenience.js.patch
 Patch106:      0006-Makefile-don-t-zip.patch
-
+Patch107:       0007-drop-convenience.js.patch
+Patch108:       0008-make-test-style-set-esversion-to-6-for-GNOME-3.32.patch
+Patch109:       0009-Mark-GNOME-3.32-as-supported-all-others-as-unsupport.patch
+Patch110:       0010-Port-GObject-classes-to-JS6-classes.patch
+Patch111:       0011-add-jshint-validthis-to-silence-warnings-about-stric.patch
+Patch112:       0012-todaysFactsWidget-add-missing-bind.patch
+Patch113:       0013-replace-Lang.bind-with-function-.bind.patch
+Patch114:       0014-Port-non-GObject-class-to-JS6.patch
+Patch115:       0015-extension.js-add-jshint-validthis-hints.patch
+Patch116:       0016-extension.js-fix-indentation-after-previous-change.patch
+Patch117:       0017-Don-t-log-ACTIVITIES-at-every-refresh.patch
+Patch118:       0018-doc-remove-broken-link-to-usejsdoc.org.patch
 BuildRequires:  fdupes
 BuildRequires:  intltool
 # For detecting typelib() dependencies
@@ -54,8 +66,8 @@
 # waf requires python2
 BuildRequires:  python
 # "waf configure" checks for these
-BuildRequires: glib2-devel
 BuildRequires: dbus-1-glib-devel
+BuildRequires:  glib2-devel
 # for help files
 BuildRequires: xml2po
 # for gconf-related rpm macros
@@ -65,7 +77,7 @@
 # For suse_update_desktop_file
 BuildRequires: update-desktop-files
 # For ownership on icon directories
-Buildrequires: hicolor-icon-theme
+BuildRequires:  hicolor-icon-theme
 # Note:
 # - we do not have the gnomeapplet bindings anymore (it doesn't work with
 #   GNOME 3), so we don't add a Requires/Recommends for it.
@@ -118,6 +130,22 @@
 %patch104 -p1
 %patch105 -p1
 %patch106 -p1
+# Tumbleweed: GNOME 3.32 support for shell extension
+# https://github.com/projecthamster/hamster-shell-extension/pull/312
+%if 0%{?suse_version} >= 1550
+%patch107 -p1
+%patch108 -p1
+%patch109 -p1
+%patch110 -p1
+%patch111 -p1
+%patch112 -p1
+%patch113 -p1
+%patch114 -p1
+%patch115 -p1
+%patch116 -p1
+%patch117 -p1
+%patch118 -p1
+%endif
 mkdir build
 cp %{SOURCE2} build
 %endif
@@ -188,10 +216,16 @@
 
 %package -n gnome-shell-extension-hamster
 Version:        2.2.2%{ext_version}
+Release:        0
 Summary:       Hamster time tracker for GNOME Shell status menu
+License:        GPL-3.0-only
 Group:         System/GUI/GNOME
-License:        GPL-3.0
-Requires:      gnome-shell
+%if 0%{?suse_version} >= 1550
+Requires:       gnome-shell >= 3.32
+%else
+Requires:       gnome-shell < 3.32
+Requires:       gnome-shell >= 3.10
+%endif
 Requires:      %{name}
 Supplements:   packageand(gnome-shell:%{name})
 

++++++ 0007-drop-convenience.js.patch ++++++
>From 6d1bdaa5174056ceaba1178cec7d0e25fea57302 Mon Sep 17 00:00:00 2001
From: Martin Wilck <[email protected]>
Date: Thu, 9 May 2019 23:09:38 +0200
Subject: [PATCH 07/18] drop convenience.js

This functionality is provided by ExtensionUtils in GNOME 3.32.
---
 Makefile               | 5 +----
 extension/extension.js | 5 ++---
 extension/prefs.js     | 3 +--
 3 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index cbc0eaa..e2b52b4 100644
--- a/Makefile
+++ b/Makefile
@@ -55,10 +55,7 @@ clean-test-docs:
 $(BUILDDIR):
        mkdir -p $@
 
-$(BUILDDIR)/convenience.js:    $(BUILDDIR)
-       wget 
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/raw/gnome-3-30/lib/convenience.js
 -O $@
-
-collect:       $(BUILDDIR)/convenience.js
+collect:
        cp -R extension/* $(BUILDDIR)
        cp -R data/* $(BUILDDIR)
 
diff --git a/extension/extension.js b/extension/extension.js
index 65ac623..532f19b 100644
--- a/extension/extension.js
+++ b/extension/extension.js
@@ -33,7 +33,6 @@ const _ = Gettext.gettext;
 
 const ExtensionUtils = imports.misc.extensionUtils;
 const Me = ExtensionUtils.getCurrentExtension();
-const Convenience = Me.imports.convenience;
 const PanelWidget = Me.imports.widgets.panelWidget.PanelWidget;
 
 // dbus-send --session --type=method_call --print-reply 
--dest=org.gnome.Hamster /org/gnome/Hamster 
org.freedesktop.DBus.Introspectable.Introspect
@@ -139,7 +138,7 @@ function Controller(extensionMeta) {
             if (!this.shouldEnable || !this.apiProxy || !this.windowsProxy)
                 return;
 
-            this.settings = Convenience.getSettings();
+            this.settings = ExtensionUtils.getSettings();
             this.panelWidget = new PanelWidget(this);
             this.placement = this.settings.get_int("panel-placement");
 
@@ -274,6 +273,6 @@ function Controller(extensionMeta) {
 
 
 function init(extensionMeta) {
-    Convenience.initTranslations();
+    ExtensionUtils.initTranslations();
     return new Controller(extensionMeta);
 }
diff --git a/extension/prefs.js b/extension/prefs.js
index dc4bc23..93ab15e 100644
--- a/extension/prefs.js
+++ b/extension/prefs.js
@@ -30,7 +30,6 @@ const Lang = imports.lang;
 
 const ExtensionUtils = imports.misc.extensionUtils;
 const Me = ExtensionUtils.getCurrentExtension();
-const Convenience = Me.imports.convenience;
 
 const HamsterSettingsWidget = new GObject.Class({
     Name: 'ProjectHamster.Prefs.HamsterSettingsWidget',
@@ -41,7 +40,7 @@ const HamsterSettingsWidget = new GObject.Class({
         this.parent(params);
         this.margin = 10;
 
-        this._settings = Convenience.getSettings();
+        this._settings = ExtensionUtils.getSettings();
 
         let vbox, label;
 
-- 
2.21.0

++++++ 0008-make-test-style-set-esversion-to-6-for-GNOME-3.32.patch ++++++
>From cafdaf6c8735c9e2c66abfaff8dab4a276b773a0 Mon Sep 17 00:00:00 2001
From: Martin Wilck <[email protected]>
Date: Thu, 9 May 2019 23:15:07 +0200
Subject: [PATCH 08/18] make test-style: set esversion to 6 for GNOME 3.32

---
 .jshint.cfg | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.jshint.cfg b/.jshint.cfg
index 122e90c..f67e5b3 100644
--- a/.jshint.cfg
+++ b/.jshint.cfg
@@ -1,3 +1,4 @@
 {
-  "moz": true
+  "moz": true,
+  "esversion": 6
 }
-- 
2.21.0

++++++ 0009-Mark-GNOME-3.32-as-supported-all-others-as-unsupport.patch ++++++
>From a86f648624f0ffd3d0083c733c858212aaaceaad Mon Sep 17 00:00:00 2001
From: Martin Wilck <[email protected]>
Date: Thu, 9 May 2019 23:54:48 +0200
Subject: [PATCH 09/18] Mark GNOME 3.32 as supported, all others as unsupported

The class syntax is unsupported in pre-ES6 versions, and
using ExtensionUtils instead of convenience.js is only possible
in 3.32.
---
 data/metadata.json | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/data/metadata.json b/data/metadata.json
index 83f2915..edf6099 100644
--- a/data/metadata.json
+++ b/data/metadata.json
@@ -10,17 +10,7 @@
     "gettext-domain": "hamster-shell-extension",
     "settings-schema": "org.gnome.shell.extensions.project-hamster",
     "shell-version": [
-        "3.10",
-        "3.12",
-        "3.14",
-        "3.16",
-        "3.18",
-        "3.20",
-        "3.22",
-        "3.24",
-        "3.26",
-        "3.28",
-        "3.30"
+        "3.32"
     ],
     "url": "https://github.com/projecthamster/hamster-shell-extension.git";,
     "uuid": "[email protected]",
-- 
2.21.0

++++++ 0010-Port-GObject-classes-to-JS6-classes.patch ++++++
>From e2a5edf3d768a0219e6cc4296e1a419b251a8f49 Mon Sep 17 00:00:00 2001
From: Martin Wilck <[email protected]>
Date: Thu, 9 May 2019 16:10:40 +0200
Subject: [PATCH 10/18] Port GObject classes to JS6 classes

This patch is required to make hamster-shell-extension work on
GNOME 3.32. At the same time, it breaks compatibility with older
gnome-shell versions that don't support ES6 class syntax.

See https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/361
Fixes https://github.com/projecthamster/hamster-shell-extension/issues/307

Heavily based on work by Ernestas Kulik <[email protected]>
---
 extension/prefs.js                        | 24 +++++------
 extension/widgets/categoryTotalsWidget.js | 18 ++++-----
 extension/widgets/factsBox.js             | 26 ++++++------
 extension/widgets/ongoingFactEntry.js     | 21 +++++-----
 extension/widgets/panelWidget.js          | 49 +++++++++++------------
 extension/widgets/todaysFactsWidget.js    | 21 +++++-----
 6 files changed, 77 insertions(+), 82 deletions(-)

diff --git a/extension/prefs.js b/extension/prefs.js
index 93ab15e..608034a 100644
--- a/extension/prefs.js
+++ b/extension/prefs.js
@@ -31,13 +31,13 @@ const Lang = imports.lang;
 const ExtensionUtils = imports.misc.extensionUtils;
 const Me = ExtensionUtils.getCurrentExtension();
 
-const HamsterSettingsWidget = new GObject.Class({
-    Name: 'ProjectHamster.Prefs.HamsterSettingsWidget',
-    GTypeName: 'HamsterSettingsWidget',
-    Extends: Gtk.VBox,
+const HamsterSettingsWidget = GObject.registerClass(
+class HamsterSettingsWidget extends Gtk.VBox {
+    _init(params) {
+        super._init(params);
+
+        this.name = 'ProjectHamster.Prefs.HamsterSettingsWidget';
 
-    _init : function(params) {
-        this.parent(params);
         this.margin = 10;
 
         this._settings = ExtensionUtils.getSettings();
@@ -114,9 +114,9 @@ const HamsterSettingsWidget = new GObject.Class({
         let version_text = 
ExtensionUtils.getCurrentExtension().metadata.version;
         let version_label_text = "You are running hamster-shell-extension 
version " + version_text;
         vbox.add(new Gtk.Label({label: version_label_text, margin_top: 10}));
-    },
+    }
 
-    _onPlacementChange: function(widget) {
+    _onPlacementChange(widget) {
         let [success, iter] = widget.get_active_iter();
         if (!success)
             return;
@@ -127,9 +127,9 @@ const HamsterSettingsWidget = new GObject.Class({
             return;
 
         this._settings.set_int("panel-placement", newPlacement);
-    },
+    }
 
-    _onAppearanceChange: function(widget) {
+    _onAppearanceChange(widget) {
         let [success, iter] = widget.get_active_iter();
         if (!success)
             return;
@@ -140,9 +140,9 @@ const HamsterSettingsWidget = new GObject.Class({
             return;
 
         this._settings.set_int("panel-appearance", newAppearance);
-    },
+    }
 
-    _onHotkeyChange: function(widget, bananas) {
+    _onHotkeyChange(widget, bananas) {
         //global.log(widget, bananas);
         let hotkey = widget.get_text();
         let [key, mods] = Gtk.accelerator_parse(hotkey);
diff --git a/extension/widgets/categoryTotalsWidget.js 
b/extension/widgets/categoryTotalsWidget.js
index 683fe92..17af747 100644
--- a/extension/widgets/categoryTotalsWidget.js
+++ b/extension/widgets/categoryTotalsWidget.js
@@ -25,6 +25,7 @@ const Lang = imports.lang;
 const St = imports.gi.St;
 const Clutter = imports.gi.Clutter;
 const GLib = imports.gi.GLib;
+const GObject = imports.gi.GObject;
 
 const Me = imports.misc.extensionUtils.getCurrentExtension();
 const Stuff = Me.imports.stuff;
@@ -33,19 +34,16 @@ const Stuff = Me.imports.stuff;
 /**
  * Custom Label widget that displays category totals.
  */
-var CategoryTotalsWidget = new Lang.Class({
-    Name: 'CategoryTotals',
-    Extends: St.Label,
-
-    _init: function() {
-        this.parent({style_class: 'summary-label'});
-
-    },
+var CategoryTotalsWidget = GObject.registerClass(
+class CategoryTotals extends St.Label {
+    _init() {
+        super._init({style_class: 'summary-label'});
+    }
 
     /**
      * Recompute values and replace old string with new one based on passed 
facts.
      */
-    refresh: function(facts) {
+    refresh(facts) {
         /**
          * Construct a string representing category totals.
          */
@@ -67,5 +65,5 @@ var CategoryTotalsWidget = new Lang.Class({
         }
 
         this.set_text(getString(facts));
-    },
+    }
 });
diff --git a/extension/widgets/factsBox.js b/extension/widgets/factsBox.js
index 42857f5..aa5a336 100644
--- a/extension/widgets/factsBox.js
+++ b/extension/widgets/factsBox.js
@@ -27,6 +27,7 @@ const PopupMenu = imports.ui.popupMenu;
 const Clutter = imports.gi.Clutter;
 const Mainloop = imports.mainloop;
 const GLib = imports.gi.GLib;
+const GObject = imports.gi.GObject;
 
 const Gettext = imports.gettext.domain('hamster-shell-extension');
 const _ = Gettext.gettext;
@@ -43,11 +44,10 @@ const TodaysFactsWidget = 
Me.imports.widgets.todaysFactsWidget.TodaysFactsWidget
  * well as todays facts.
  * @class
  */
-var FactsBox = new Lang.Class({
-    Name: 'FactsBox',
-    Extends: PopupMenu.PopupBaseMenuItem,
-    _init: function(controller, panelWidget) {
-        this.parent({reactive: false});
+var FactsBox =
+class FactsBox extends PopupMenu.PopupBaseMenuItem {
+    constructor(controller, panelWidget) {
+        super({reactive: false});
 
         this._controller = controller;
 
@@ -79,32 +79,32 @@ var FactsBox = new Lang.Class({
         // Setup category summery
         this.summaryLabel = new CategoryTotalsWidget();
         main_box.add(this.summaryLabel);
-    },
+    }
 
     // [FIXME]
     // The best solution would be to listen for a 'FactsChanged' Signal that 
carries the new
     // facts as payload and just refresh with this. But for now we stick with 
this
     // simpler version.
-    refresh: function(facts, ongoingFact) {
+    refresh(facts, ongoingFact) {
         this.todaysFactsWidget.refresh(facts, ongoingFact);
         this.summaryLabel.refresh(facts);
 
-    },
+    }
 
     /**
      * Focus the fact entry and make sure todaysFactsWidget are scrolled to 
the bottom.
      */
-    focus: function() {
+    focus() {
         Mainloop.timeout_add(20, Lang.bind(this, function() {
             this._scrollAdjustment.value = this._scrollAdjustment.upper;
             global.stage.set_key_focus(this.ongoingFactEntry);
         }));
-    },
+    }
 
     /**
      * Remove any existing focus.
      */
-    unfocus: function() {
+    unfocus() {
         global.stage.set_key_focus(null);
-    },
-});
+    }
+};
diff --git a/extension/widgets/ongoingFactEntry.js 
b/extension/widgets/ongoingFactEntry.js
index a46948d..b90238e 100644
--- a/extension/widgets/ongoingFactEntry.js
+++ b/extension/widgets/ongoingFactEntry.js
@@ -22,6 +22,7 @@ Copyright (c) 2016 - 2018 Eric Goller / projecthamster 
<elbenfreund@projecthamst
 
 
 const Lang = imports.lang;
+const GObject = imports.gi.GObject;
 const St = imports.gi.St;
 const Clutter = imports.gi.Clutter;
 
@@ -39,12 +40,10 @@ const Me = 
imports.misc.extensionUtils.getCurrentExtension();
  *
  *
  */
-var OngoingFactEntry = new Lang.Class({
-    Name: 'OngoingFactEntry',
-    Extends: St.Entry,
-
-    _init: function(controller) {
-        this.parent({
+var OngoingFactEntry = GObject.registerClass(
+class OngoingFactEntry extends St.Entry {
+    _init(controller) {
+        super._init({
             name: 'searchEntry',
             can_focus: true,
             track_hover: true,
@@ -59,7 +58,7 @@ var OngoingFactEntry = new Lang.Class({
         this._runningActivitiesQuery = null;
         this.clutter_text.connect('activate', Lang.bind(this, 
this._onEntryActivated));
         this.clutter_text.connect('key-release-event', Lang.bind(this, 
this._onKeyReleaseEvent));
-    },
+    }
 
     /**
      * Callback for when ``ongoingFactEntry`` gets activated.
@@ -70,13 +69,13 @@ var OngoingFactEntry = new Lang.Class({
      *
      * @callback FactsBox~_onEntryActivated
      */
-    _onEntryActivated: function() {
+    _onEntryActivated() {
         let text = this.get_text();
         this._controller.apiProxy.AddFactRemote(text, 0, 0, false, 
Lang.bind(this, function(response, error) {
             // not interested in the new id - this shuts up the warning
         }));
         this.set_text('');
-    },
+    }
 
     /**
      * Callback triggered after key release.
@@ -85,7 +84,7 @@ var OngoingFactEntry = new Lang.Class({
      *
      * @callback FactsBox~_onKeyReleaseEvent
      */
-    _onKeyReleaseEvent: function(textItem, evt) {
+    _onKeyReleaseEvent(textItem, evt) {
         /**
          * Check if the passed key is on our list of keys to be ignored.
          */
@@ -185,5 +184,5 @@ var OngoingFactEntry = new Lang.Class({
                 this._prevText = completion.toLowerCase();
             }
         }
-    },
+    }
 });
diff --git a/extension/widgets/panelWidget.js b/extension/widgets/panelWidget.js
index d43833d..7328ba0 100644
--- a/extension/widgets/panelWidget.js
+++ b/extension/widgets/panelWidget.js
@@ -23,6 +23,7 @@ Copyright (c) 2016 - 2018 Eric Goller / projecthamster 
<elbenfreund@projecthamst
 
 const Lang = imports.lang;
 const Gio = imports.gi.Gio;
+const GObject = imports.gi.GObject;
 const Clutter = imports.gi.Clutter;
 const PanelMenu = imports.ui.panelMenu;
 const St = imports.gi.St;
@@ -55,14 +56,12 @@ const Stuff = Me.imports.stuff;
  *
  * @class
  */
-var PanelWidget = new Lang.Class({
-    Name: 'PanelWidget',
-    Extends: PanelMenu.Button,
-
-    _init: function(controller) {
+var PanelWidget = GObject.registerClass(
+class PanelWidget extends PanelMenu.Button {
+    _init(controller) {
         // [FIXME]
         // What is the parameter?
-        this.parent(0.0);
+        super._init(0.0);
 
         this._controller = controller;
         // [FIXME]
@@ -140,7 +139,7 @@ var PanelWidget = new Lang.Class({
         this.timeout = GLib.timeout_add_seconds(0, 60, Lang.bind(this, 
this.refresh));
         this.connect('destroy', Lang.bind(this, this._disableRefreshTimer));
         this.refresh();
-    },
+    }
 
     /**
      * This is our main 'update/refresh' method.
@@ -152,7 +151,7 @@ var PanelWidget = new Lang.Class({
      * required facts etc and pass them to the relevant sub-widget's
      * refresh methods.
      */
-    refresh: function() {
+    refresh() {
     /**
      * We need to wrap our actual refresh code in this callback for now as
      * I am having major difficulties using a syncronous dbus method call to
@@ -197,21 +196,21 @@ var PanelWidget = new Lang.Class({
     // here.
     this._controller.apiProxy.GetTodaysFactsRemote(Lang.bind(this, _refresh));
     return GLib.SOURCE_CONTINUE;
-    },
+    }
 
     /**
      * Open 'popup menu' containing the bulk of the extension widgets.
      */
-    show: function() {
+    show() {
         this.menu.open();
-    },
+    }
 
     /**
      * Close/Open the 'popup menu' depending on previous state.
      */
-    toggle: function() {
+    toggle() {
         this.menu.toggle();
-    },
+    }
 
 
     /**
@@ -220,7 +219,7 @@ var PanelWidget = new Lang.Class({
      * Depending on the 'display mode' set in the extensions settings this has
      * slightly different consequences.
      */
-    updatePanelDisplay: function(fact) {
+    updatePanelDisplay(fact) {
         /**
          * Return a text string representing the passed fact suitable for the 
panelLabel.
          *
@@ -262,7 +261,7 @@ var PanelWidget = new Lang.Class({
                 this.panelLabel.show();
                 break;
         }
-    },
+    }
 
     /**
      * Disable the refresh timer.
@@ -272,9 +271,9 @@ var PanelWidget = new Lang.Class({
      * This method is actually a callback triggered on the destroy
      * signal.
      */
-    _disableRefreshTimer: function() {
+    _disableRefreshTimer() {
         GLib.source_remove(this.timeout);
-    },
+    }
 
     /**
      * Callback to be triggered when an *ongoing fact* is stopped.
@@ -283,7 +282,7 @@ var PanelWidget = new Lang.Class({
      * This will get the current time and issue the ``StopTracking``
      * method call to the dbus interface.
      */
-    _onStopTracking: function() {
+    _onStopTracking() {
         let now = new Date();
         let epochSeconds = Date.UTC(now.getFullYear(),
                                     now.getMonth(),
@@ -293,25 +292,25 @@ var PanelWidget = new Lang.Class({
                                     now.getSeconds());
         epochSeconds = Math.floor(epochSeconds / 1000);
         this._controller.apiProxy.StopTrackingRemote(GLib.Variant.new('i', 
[epochSeconds]));
-    },
+    }
 
     /**
      * Callback that triggers opening of the *Overview*-Window.
      *
      * @callback panelWidget~_onOpenOverview
      */
-    _onOpenOverview: function() {
+    _onOpenOverview() {
         this._controller.windowsProxy.overviewSync();
-    },
+    }
 
     /**
      * Callback that triggers opening of the *Add Fact*-Window.
      *
      * @callback panelWidget~_onOpenAddFact
      */
-    _onOpenAddFact: function() {
+    _onOpenAddFact() {
         this._controller.windowsProxy.editSync(GLib.Variant.new('i', [0]));
-    },
+    }
 
     /**
      * Callback that triggers opening of the *Add Fact*-Window.
@@ -320,7 +319,7 @@ var PanelWidget = new Lang.Class({
      *
      * Note: This will open the GUI settings, not the extension settings!
      */
-    _onOpenSettings: function() {
+    _onOpenSettings() {
         this._controller.windowsProxy.preferencesSync();
-    },
+    }
 });
diff --git a/extension/widgets/todaysFactsWidget.js 
b/extension/widgets/todaysFactsWidget.js
index 1ec2de3..1b7f84a 100644
--- a/extension/widgets/todaysFactsWidget.js
+++ b/extension/widgets/todaysFactsWidget.js
@@ -25,6 +25,7 @@ const Lang = imports.lang;
 const St = imports.gi.St;
 const Clutter = imports.gi.Clutter;
 const GLib = imports.gi.GLib;
+const GObject = imports.gi.GObject;
 
 const Me = imports.misc.extensionUtils.getCurrentExtension();
 const Stuff = Me.imports.stuff;
@@ -33,12 +34,10 @@ const Stuff = Me.imports.stuff;
 /**
  * A widget that lists all facts for *today*.
  */
-var TodaysFactsWidget = new Lang.Class({
-    Name: 'TodaysFactsWidget',
-    Extends: St.ScrollView,
-
-    _init: function(controller, panelWidget) {
-        this.parent({style_class: 'hamster-scrollbox'});
+var TodaysFactsWidget = GObject.registerClass(
+class TodaysFactsWidget extends St.ScrollView {
+    _init(controller, panelWidget) {
+        super._init({style_class: 'hamster-scrollbox'});
         this._controller = controller;
         this._panelWidget = panelWidget;
 
@@ -53,12 +52,12 @@ var TodaysFactsWidget = new Lang.Class({
         this.factsBox.add(this.facts_widget);
         this.add_actor(this.factsBox);
 
-    },
+    }
 
     /**
      * Populate the widget with rows representing the passed facts.
      */
-    populateFactsWidget: function(facts, ongoingFact) {
+    populateFactsWidget(facts, ongoingFact) {
 
         /**
          * Construct an individual row within the widget - representing a 
single fact.
@@ -181,13 +180,13 @@ var TodaysFactsWidget = new Lang.Class({
             }
             rowCount += 1;
         }
-    },
+    }
 
     /**
      * Clear the widget and populate it anew.
      */
-    refresh: function(facts, ongoingFact) {
+    refresh(facts, ongoingFact) {
         this.facts_widget.remove_all_children();
         this.populateFactsWidget(facts, ongoingFact);
-    },
+    }
 });
-- 
2.21.0

++++++ 0011-add-jshint-validthis-to-silence-warnings-about-stric.patch ++++++
>From 3135c6e58ec533b28e695840273f9a84e0b194d2 Mon Sep 17 00:00:00 2001
From: Martin Wilck <[email protected]>
Date: Thu, 9 May 2019 16:50:25 +0200
Subject: [PATCH 11/18] add "jshint validthis" to silence warnings about strict
 mode

I haven't found a more elegant way to fix these warnings,
which break "make test-style".
---
 extension/widgets/panelWidget.js       | 1 +
 extension/widgets/todaysFactsWidget.js | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/extension/widgets/panelWidget.js b/extension/widgets/panelWidget.js
index 7328ba0..de77f4a 100644
--- a/extension/widgets/panelWidget.js
+++ b/extension/widgets/panelWidget.js
@@ -165,6 +165,7 @@ class PanelWidget extends PanelMenu.Button {
          *
          * Returns ``null`` if there is no *ongoing fact*.
          */
+        /* jshint validthis: true */
                function getOngoingFact(facts) {
                    let result = null;
                    if (facts.length) {
diff --git a/extension/widgets/todaysFactsWidget.js 
b/extension/widgets/todaysFactsWidget.js
index 1b7f84a..cb74fd7 100644
--- a/extension/widgets/todaysFactsWidget.js
+++ b/extension/widgets/todaysFactsWidget.js
@@ -66,6 +66,7 @@ class TodaysFactsWidget extends St.ScrollView {
             /**
              * Check if two facts have the same activity.
              */
+           /* jshint validthis: true */
             function checkSameActivity(fact, otherFact) {
                 // Check if two facts have the same activity.
                 let result = true;
@@ -112,6 +113,7 @@ class TodaysFactsWidget extends St.ScrollView {
                     factStr += " #" + fact.tags.join(", #");
                 }
 
+               /* jshint validthis: true */
                 controller.apiProxy.AddFactRemote(factStr, 0, 0, false, 
Lang.bind(this, function(response, err) {
                     // not interested in the new id - this shuts up the warning
                 }));
-- 
2.21.0

++++++ 0012-todaysFactsWidget-add-missing-bind.patch ++++++
>From bd99b78b720acf12426a64399fbcf59b91b7b3eb Mon Sep 17 00:00:00 2001
From: Martin Wilck <[email protected]>
Date: Thu, 9 May 2019 18:59:03 +0200
Subject: [PATCH 12/18] todaysFactsWidget: add missing bind()

Without this, Lang.bind() in constructRow() throws the error
"Error: first argument to Lang.bind() must be an object, not undefined"
---
 extension/widgets/todaysFactsWidget.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/extension/widgets/todaysFactsWidget.js 
b/extension/widgets/todaysFactsWidget.js
index cb74fd7..1d8acf5 100644
--- a/extension/widgets/todaysFactsWidget.js
+++ b/extension/widgets/todaysFactsWidget.js
@@ -176,7 +176,7 @@ class TodaysFactsWidget extends St.ScrollView {
         let rowCount = 0;
         let layout = this.facts_widget.layout_manager;
         for (let fact of facts) {
-            let rowComponents = constructRow(fact, ongoingFact, 
this._controller, this._panelWidget.menu);
+            let rowComponents = Lang.bind(this, constructRow)(fact, 
ongoingFact, this._controller, this._panelWidget.menu);
             for (let component of rowComponents) {
                 layout.pack(component, rowComponents.indexOf(component), 
rowCount);
             }
-- 
2.21.0

++++++ 0013-replace-Lang.bind-with-function-.bind.patch ++++++
>From ab5df1123857b3b1b6efc463f7bba7aa448192b7 Mon Sep 17 00:00:00 2001
From: Martin Wilck <[email protected]>
Date: Thu, 9 May 2019 22:35:44 +0200
Subject: [PATCH 13/18] replace Lang.bind() with $(function).bind()

Code cleanup. Mostly gets rid of the Lang module.
Don't use arrow functions just yet.
---
 extension/extension.js                    | 16 +++++++--------
 extension/prefs.js                        |  7 +++----
 extension/widgets/categoryTotalsWidget.js |  1 -
 extension/widgets/factsBox.js             |  7 +++----
 extension/widgets/ongoingFactEntry.js     |  9 ++++----
 extension/widgets/panelWidget.js          | 25 +++++++++++------------
 extension/widgets/todaysFactsWidget.js    | 11 +++++-----
 7 files changed, 35 insertions(+), 41 deletions(-)

diff --git a/extension/extension.js b/extension/extension.js
index 532f19b..3168827 100644
--- a/extension/extension.js
+++ b/extension/extension.js
@@ -120,16 +120,16 @@ function Controller(extensionMeta) {
         enable: function() {
             this.shouldEnable = true;
             new ApiProxy(Gio.DBus.session, 'org.gnome.Hamster', 
'/org/gnome/Hamster',
-                Lang.bind(this, function(proxy) {
+                function(proxy) {
                     this.apiProxy = proxy;
                     this.deferred_enable();
-                }));
+                }.bind(this));
             new WindowsProxy(Gio.DBus.session, 
"org.gnome.Hamster.WindowServer",
                 "/org/gnome/Hamster/WindowServer",
-                Lang.bind(this, function(proxy) {
+                function(proxy) {
                     this.windowsProxy = proxy;
                     this.deferred_enable();
-                }));
+                }.bind(this));
         },
 
         deferred_enable: function() {
@@ -172,7 +172,7 @@ function Controller(extensionMeta) {
                 Gio.BusNameWatcherFlags.NONE, 
windowsProxy_appeared_callback.bind(this),
                 windowsProxy_vanished_callback.bind(this));
 
-            this.apiProxy.connectSignal('ActivitiesChanged', Lang.bind(this, 
this.refreshActivities));
+            this.apiProxy.connectSignal('ActivitiesChanged', 
this.refreshActivities.bind(this));
             this.refreshActivities();
 
             Main.panel.menuManager.addMenu(this.panelWidget.menu);
@@ -181,7 +181,7 @@ function Controller(extensionMeta) {
                 Meta.KeyBindingFlags.NONE,
                 // Since Gnome 3.16, Shell.KeyBindingMode is replaced by 
Shell.ActionMode
                 Shell.KeyBindingMode ? Shell.KeyBindingMode.ALL : 
Shell.ActionMode.ALL,
-                Lang.bind(this.panelWidget, this.panelWidget.toggle)
+                                 this.panelWidget.toggle.bind(this.panelWidget)
             );
         },
 
@@ -212,11 +212,11 @@ function Controller(extensionMeta) {
                 }
 
                 this.runningActivitiesQuery = true;
-                controller.apiProxy.GetActivitiesRemote("", Lang.bind(this, 
function([response], err) {
+                controller.apiProxy.GetActivitiesRemote("", 
function([response], err) {
                   controller.runningActivitiesQuery = false;
                   controller.activities = response;
                   global.log('ACTIVITIES HAMSTER: ', controller.activities);
-                }));
+                }.bind(this));
             }
 
             getActivities(this);
diff --git a/extension/prefs.js b/extension/prefs.js
index 608034a..3555673 100644
--- a/extension/prefs.js
+++ b/extension/prefs.js
@@ -25,7 +25,6 @@ const Gdk = imports.gi.Gdk;
 const Gio = imports.gi.Gio;
 const Gtk = imports.gi.Gtk;
 const GObject = imports.gi.GObject;
-const Lang = imports.lang;
 
 
 const ExtensionUtils = imports.misc.extensionUtils;
@@ -64,7 +63,7 @@ class HamsterSettingsWidget extends Gtk.VBox {
         let placementComboRenderer = new Gtk.CellRendererText();
         placementCombo.pack_start(placementComboRenderer, true);
         placementCombo.add_attribute(placementComboRenderer, 'text', 0);
-        placementCombo.connect('changed', Lang.bind(this, 
this._onPlacementChange));
+        placementCombo.connect('changed', this._onPlacementChange.bind(this));
         placementCombo.set_active(this._settings.get_int("panel-placement"));
 
         vbox.add(placementCombo);
@@ -89,7 +88,7 @@ class HamsterSettingsWidget extends Gtk.VBox {
         let appearanceComboRenderer = new Gtk.CellRendererText();
         appearanceCombo.pack_start(appearanceComboRenderer, true);
         appearanceCombo.add_attribute(appearanceComboRenderer, 'text', 0);
-        appearanceCombo.connect('changed', Lang.bind(this, 
this._onAppearanceChange));
+        appearanceCombo.connect('changed', 
this._onAppearanceChange.bind(this));
         appearanceCombo.set_active(this._settings.get_int("panel-appearance"));
 
         vbox.add(appearanceCombo);
@@ -106,7 +105,7 @@ class HamsterSettingsWidget extends Gtk.VBox {
                                    margin_top: 5,
                                    text: 
this._settings.get_strv("show-hamster-dropdown")[0]});
         vbox.add(entry);
-        entry.connect('changed', Lang.bind(this, this._onHotkeyChange));
+        entry.connect('changed', this._onHotkeyChange.bind(this));
 
         vbox.add(new Gtk.Label({label: "Reload gnome shell after updating 
prefs (alt+f2 > r)",
                                 margin_top: 70}));
diff --git a/extension/widgets/categoryTotalsWidget.js 
b/extension/widgets/categoryTotalsWidget.js
index 17af747..88f9b96 100644
--- a/extension/widgets/categoryTotalsWidget.js
+++ b/extension/widgets/categoryTotalsWidget.js
@@ -21,7 +21,6 @@ Copyright (c) 2016 - 2018 Eric Goller / projecthamster 
<elbenfreund@projecthamst
 */
 
 
-const Lang = imports.lang;
 const St = imports.gi.St;
 const Clutter = imports.gi.Clutter;
 const GLib = imports.gi.GLib;
diff --git a/extension/widgets/factsBox.js b/extension/widgets/factsBox.js
index aa5a336..5deb703 100644
--- a/extension/widgets/factsBox.js
+++ b/extension/widgets/factsBox.js
@@ -21,7 +21,6 @@ Copyright (c) 2016 - 2018 Eric Goller / projecthamster 
<elbenfreund@projecthamst
 */
 
 
-const Lang = imports.lang;
 const St = imports.gi.St;
 const PopupMenu = imports.ui.popupMenu;
 const Clutter = imports.gi.Clutter;
@@ -62,7 +61,7 @@ class FactsBox extends PopupMenu.PopupBaseMenuItem {
         main_box.add(_ongoingFactLabel);
 
         this.ongoingFactEntry = new OngoingFactEntry(this._controller);
-        //this.ongoingFactEntry.clutter_text.connect('key-release-event', 
Lang.bind(this, this._onKeyReleaseEvent));
+        //this.ongoingFactEntry.clutter_text.connect('key-release-event', 
this._onKeyReleaseEvent.bind(this));
         main_box.add(this.ongoingFactEntry);
 
         let fact_list_label = new St.Label({style_class: 'hamster-box-label'});
@@ -95,10 +94,10 @@ class FactsBox extends PopupMenu.PopupBaseMenuItem {
      * Focus the fact entry and make sure todaysFactsWidget are scrolled to 
the bottom.
      */
     focus() {
-        Mainloop.timeout_add(20, Lang.bind(this, function() {
+        Mainloop.timeout_add(20, function() {
             this._scrollAdjustment.value = this._scrollAdjustment.upper;
             global.stage.set_key_focus(this.ongoingFactEntry);
-        }));
+        }.bind(this));
     }
 
     /**
diff --git a/extension/widgets/ongoingFactEntry.js 
b/extension/widgets/ongoingFactEntry.js
index b90238e..688aa6b 100644
--- a/extension/widgets/ongoingFactEntry.js
+++ b/extension/widgets/ongoingFactEntry.js
@@ -21,7 +21,6 @@ Copyright (c) 2016 - 2018 Eric Goller / projecthamster 
<elbenfreund@projecthamst
 */
 
 
-const Lang = imports.lang;
 const GObject = imports.gi.GObject;
 const St = imports.gi.St;
 const Clutter = imports.gi.Clutter;
@@ -56,8 +55,8 @@ class OngoingFactEntry extends St.Entry {
         // Seems to be populate by GetActivities.
         this._autocompleteActivities = [];
         this._runningActivitiesQuery = null;
-        this.clutter_text.connect('activate', Lang.bind(this, 
this._onEntryActivated));
-        this.clutter_text.connect('key-release-event', Lang.bind(this, 
this._onKeyReleaseEvent));
+        this.clutter_text.connect('activate', 
this._onEntryActivated.bind(this));
+        this.clutter_text.connect('key-release-event', 
this._onKeyReleaseEvent.bind(this));
     }
 
     /**
@@ -71,9 +70,9 @@ class OngoingFactEntry extends St.Entry {
      */
     _onEntryActivated() {
         let text = this.get_text();
-        this._controller.apiProxy.AddFactRemote(text, 0, 0, false, 
Lang.bind(this, function(response, error) {
+        this._controller.apiProxy.AddFactRemote(text, 0, 0, false, 
function(response, error) {
             // not interested in the new id - this shuts up the warning
-        }));
+       }.bind(this));
         this.set_text('');
     }
 
diff --git a/extension/widgets/panelWidget.js b/extension/widgets/panelWidget.js
index de77f4a..905623a 100644
--- a/extension/widgets/panelWidget.js
+++ b/extension/widgets/panelWidget.js
@@ -21,7 +21,6 @@ Copyright (c) 2016 - 2018 Eric Goller / projecthamster 
<elbenfreund@projecthamst
 */
 
 
-const Lang = imports.lang;
 const Gio = imports.gi.Gio;
 const GObject = imports.gi.GObject;
 const Clutter = imports.gi.Clutter;
@@ -70,8 +69,8 @@ class PanelWidget extends PanelMenu.Button {
         this._settings = controller.settings;
         this._windowsProxy = controller.windowsProxy;
 
-        controller.apiProxy.connectSignal('FactsChanged',      Lang.bind(this, 
this.refresh));
-        controller.apiProxy.connectSignal('TagsChanged',       Lang.bind(this, 
this.refresh));
+        controller.apiProxy.connectSignal('FactsChanged',      
this.refresh.bind(this));
+        controller.apiProxy.connectSignal('TagsChanged',       
this.refresh.bind(this));
 
 
         // Setup the main layout container for the part of the extension
@@ -103,41 +102,41 @@ class PanelWidget extends PanelMenu.Button {
 
         // overview
         let overviewMenuItem = new PopupMenu.PopupMenuItem(_("Show Overview"));
-        overviewMenuItem.connect('activate', Lang.bind(this, 
this._onOpenOverview));
+        overviewMenuItem.connect('activate', this._onOpenOverview.bind(this));
         this.menu.addMenuItem(overviewMenuItem);
 
         // [FIXME]
         // This should only be shown if we have an 'ongoing fact'.
         // stop tracking
         let stopTrackinMenuItem = new PopupMenu.PopupMenuItem(_("Stop 
Tracking"));
-        stopTrackinMenuItem.connect('activate', Lang.bind(this, 
this._onStopTracking));
+        stopTrackinMenuItem.connect('activate', 
this._onStopTracking.bind(this));
         this.menu.addMenuItem(stopTrackinMenuItem);
 
         // add new task
         let addNewFactMenuItem = new PopupMenu.PopupMenuItem(_("Add Earlier 
Activity"));
-        addNewFactMenuItem.connect('activate', Lang.bind(this, 
this._onOpenAddFact));
+        addNewFactMenuItem.connect('activate', this._onOpenAddFact.bind(this));
         this.menu.addMenuItem(addNewFactMenuItem);
 
         // settings
         this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
         let SettingMenuItem = new PopupMenu.PopupMenuItem(_("Tracking 
Settings"));
-        SettingMenuItem.connect('activate', Lang.bind(this, 
this._onOpenSettings));
+        SettingMenuItem.connect('activate', this._onOpenSettings.bind(this));
         this.menu.addMenuItem(SettingMenuItem);
 
         // focus menu upon display
-        this.menu.connect('open-state-changed', Lang.bind(this,
+        this.menu.connect('open-state-changed',
             function(menu, open) {
                 if (open) {
                     this.factsBox.focus();
                 } else {
                     this.factsBox.unfocus();
                 }
-            }
-        ));
+            }.bind(this)
+        );
 
         // refresh the widget every 60 secs
-        this.timeout = GLib.timeout_add_seconds(0, 60, Lang.bind(this, 
this.refresh));
-        this.connect('destroy', Lang.bind(this, this._disableRefreshTimer));
+        this.timeout = GLib.timeout_add_seconds(0, 60, 
this.refresh.bind(this));
+        this.connect('destroy', this._disableRefreshTimer.bind(this));
         this.refresh();
     }
 
@@ -195,7 +194,7 @@ class PanelWidget extends PanelMenu.Button {
     // This should really be a synchronous call fetching the facts.
     // Once this is done, the actual code from the callback should follow
     // here.
-    this._controller.apiProxy.GetTodaysFactsRemote(Lang.bind(this, _refresh));
+    this._controller.apiProxy.GetTodaysFactsRemote(_refresh.bind(this));
     return GLib.SOURCE_CONTINUE;
     }
 
diff --git a/extension/widgets/todaysFactsWidget.js 
b/extension/widgets/todaysFactsWidget.js
index 1d8acf5..deafbdc 100644
--- a/extension/widgets/todaysFactsWidget.js
+++ b/extension/widgets/todaysFactsWidget.js
@@ -21,7 +21,6 @@ Copyright (c) 2016 - 2018 Eric Goller / projecthamster 
<elbenfreund@projecthamst
 */
 
 
-const Lang = imports.lang;
 const St = imports.gi.St;
 const Clutter = imports.gi.Clutter;
 const GLib = imports.gi.GLib;
@@ -114,9 +113,9 @@ class TodaysFactsWidget extends St.ScrollView {
                 }
 
                /* jshint validthis: true */
-                controller.apiProxy.AddFactRemote(factStr, 0, 0, false, 
Lang.bind(this, function(response, err) {
+                controller.apiProxy.AddFactRemote(factStr, 0, 0, false, 
function(response, err) {
                     // not interested in the new id - this shuts up the warning
-                }));
+                }.bind(this));
                 menu.close();
             }
 
@@ -148,7 +147,7 @@ class TodaysFactsWidget extends St.ScrollView {
             editButton.set_child(editIcon);
             // [FIXME]
             // Wouldn't it be cleaner to pass the fact as data payload to the 
callback binding?
-            editButton.connect('clicked', Lang.bind(this, onOpenEditDialog));
+            editButton.connect('clicked', onOpenEditDialog.bind(this));
 
             // Construct a 'start previous fact's activity as new' button.
             // This is only done if the *ongoing fact* activity is actually
@@ -160,7 +159,7 @@ class TodaysFactsWidget extends St.ScrollView {
                 continueButton = new St.Button({style_class: 'clickable 
cell-button'});
                 continueButton.set_child(continueIcon);
                 continueButton.fact = fact;
-                continueButton.connect('clicked', Lang.bind(this, 
onContinueButton));
+                continueButton.connect('clicked', onContinueButton.bind(this));
             }
 
             //The order of the array will be the order in which they will be 
added to the row.
@@ -176,7 +175,7 @@ class TodaysFactsWidget extends St.ScrollView {
         let rowCount = 0;
         let layout = this.facts_widget.layout_manager;
         for (let fact of facts) {
-            let rowComponents = Lang.bind(this, constructRow)(fact, 
ongoingFact, this._controller, this._panelWidget.menu);
+            let rowComponents = constructRow.bind(this)(fact, ongoingFact, 
this._controller, this._panelWidget.menu);
             for (let component of rowComponents) {
                 layout.pack(component, rowComponents.indexOf(component), 
rowCount);
             }
-- 
2.21.0

++++++ 0014-Port-non-GObject-class-to-JS6.patch ++++++
>From 9386973450e23e6d619c35fe563eb6cc6afb6935 Mon Sep 17 00:00:00 2001
From: Martin Wilck <[email protected]>
Date: Thu, 9 May 2019 23:44:04 +0200
Subject: [PATCH 14/18] Port non-GObject class to JS6

Continue port to ES6 by converting the Controller class, too.
This is not strictly necessary to make the extension work,
but allows dropping the "Lang" module.
This patch deliberately breaks indentation, for ease of review.

Heavily based on work by Ernestas Kulik <[email protected]>
---
 extension/extension.js | 65 ++++++++++++++++++------------------------
 1 file changed, 28 insertions(+), 37 deletions(-)

diff --git a/extension/extension.js b/extension/extension.js
index 3168827..abd17de 100644
--- a/extension/extension.js
+++ b/extension/extension.js
@@ -22,7 +22,6 @@ Copyright (c) 2016 - 2018 Eric Goller / projecthamster 
<elbenfreund@projecthamst
 
 
 const GLib = imports.gi.GLib;
-const Lang = imports.lang;
 const Shell = imports.gi.Shell;
 const Meta = imports.gi.Meta;
 const Main = imports.ui.main;
@@ -93,19 +92,20 @@ let WindowsProxy = 
Gio.DBusProxy.makeProxyWrapper(WindowsProxyIface);
  *
  * @class
  */
-function Controller(extensionMeta) {
+class Controller {
+    constructor(extensionMeta) {
     let dateMenu = Main.panel.statusArea.dateMenu;
 
-    return {
-        extensionMeta: extensionMeta,
-        panelWidget: null,
-        settings: null,
-        placement: 0,
-        apiProxy: null,
-        windowsProxy: null,
+        this.extensionMeta = extensionMeta;
+        this.panelWidget = null;
+        this.settings = null;
+        this.placement = 0;
+        this.apiProxy = null;
+        this.windowsProxy = null;
         // ``shouldEnable`` indicates if the 'magic' enable function has been 
called or not.
         // for details please see: 
https://github.com/projecthamster/hamster-shell-extension/pull/239
-        shouldEnable: false,
+        this.shouldEnable = false;
+    }
 
         /**
          * 'Magic' method, called upon extension launch.
@@ -117,7 +117,7 @@ function Controller(extensionMeta) {
          *  We only set up our dbus proxies here. In order to be able to do so 
asynchronously all
          *  the actual startup code is refered to ``deferred_enable``.
          */
-        enable: function() {
+       enable() {
             this.shouldEnable = true;
             new ApiProxy(Gio.DBus.session, 'org.gnome.Hamster', 
'/org/gnome/Hamster',
                 function(proxy) {
@@ -130,9 +130,9 @@ function Controller(extensionMeta) {
                     this.windowsProxy = proxy;
                     this.deferred_enable();
                 }.bind(this));
-        },
+        }
 
-        deferred_enable: function() {
+        deferred_enable() {
             // Make sure ``enable`` is 'finished' and ``disable`` has not been
             // called in between.
             if (!this.shouldEnable || !this.apiProxy || !this.windowsProxy)
@@ -183,9 +183,9 @@ function Controller(extensionMeta) {
                 Shell.KeyBindingMode ? Shell.KeyBindingMode.ALL : 
Shell.ActionMode.ALL,
                                  this.panelWidget.toggle.bind(this.panelWidget)
             );
-        },
+        }
 
-        disable: function() {
+        disable() {
             this.shouldEnable = false;
             Main.wm.removeKeybinding("show-hamster-dropdown");
 
@@ -196,37 +196,29 @@ function Controller(extensionMeta) {
             this.panelWidget = null;
             this.apiProxy = null;
             this.windowsProxy = null;
-        },
+        }
 
         /**
          * Build a new cache of all activities present in the backend.
          */
-        refreshActivities: function() {
-            /**
-             * Return an Array of [Activity.name, Activity.category.name] 
Arrays.
-             *
-             */
-            function getActivities(controller) {
-                if (controller.runningActivitiesQuery) {
-                    return(controller.activities);
+        refreshActivities() {
+                if (this.runningActivitiesQuery) {
+                    return(this.activities);
                 }
 
                 this.runningActivitiesQuery = true;
-                controller.apiProxy.GetActivitiesRemote("", 
function([response], err) {
-                  controller.runningActivitiesQuery = false;
-                  controller.activities = response;
-                  global.log('ACTIVITIES HAMSTER: ', controller.activities);
+                this.apiProxy.GetActivitiesRemote("", function([response], 
err) {
+                  this.runningActivitiesQuery = false;
+                  this.activities = response;
+                  global.log('ACTIVITIES HAMSTER: ', this.activities);
                 }.bind(this));
-            }
-
-            getActivities(this);
-        },
+        }
 
         /**
          * Place the actual extension wi
          * get in the right place according to settings.
          */
-        _placeWidget: function(placement, panelWidget) {
+        _placeWidget(placement, panelWidget) {
             if (placement == 1) {
                 // 'Replace calendar'
                 Main.panel.addToStatusArea("hamster", this.panelWidget, 0, 
"center");
@@ -246,9 +238,9 @@ function Controller(extensionMeta) {
                 // 'Default'
                 Main.panel.addToStatusArea("hamster", this.panelWidget, 0, 
"right");
             }
-        },
+        }
 
-        _removeWidget: function(placement) {
+        _removeWidget(placement) {
             if (placement == 1) {
                 // We replaced the calendar
                 Main.panel._rightBox.remove_actor(dateMenu.container);
@@ -267,8 +259,7 @@ function Controller(extensionMeta) {
             } else {
                 Main.panel._rightBox.remove_actor(this.panelWidget.container);
             }
-        },
-    };
+        }
 }
 
 
-- 
2.21.0

++++++ 0015-extension.js-add-jshint-validthis-hints.patch ++++++
>From 0dcf885a16a77b00885049fdd21b1d24909415f9 Mon Sep 17 00:00:00 2001
From: Martin Wilck <[email protected]>
Date: Thu, 9 May 2019 23:47:25 +0200
Subject: [PATCH 15/18] extension.js: add jshint validthis hints

---
 extension/extension.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/extension/extension.js b/extension/extension.js
index abd17de..3c84759 100644
--- a/extension/extension.js
+++ b/extension/extension.js
@@ -149,6 +149,7 @@ class Controller {
             }
 
             function apiProxy_vanished_callback() {
+               /* jshint validthis: true */
                 global.log(_("hamster-shell-extension: 'hamster-service' not 
running. Shutting down."));
                 Main.notify(_("hamster-shell-extension: 'hamster-service' not 
running. Shutting down."));
                 this.disable();
@@ -158,6 +159,7 @@ class Controller {
             }
 
             function windowsProxy_vanished_callback() {
+               /* jshint validthis: true */
                 global.log(_("hamster-shell-extension: 
'hamster-windows-service' not running. Shutting down."));
                 Main.notify(_("hamster-shell-extension: 
'hamster-windows-service' not running. Shutting down."));
                 this.disable();
-- 
2.21.0

++++++ 0016-extension.js-fix-indentation-after-previous-change.patch ++++++
>From f284c2d1d9c55aa6be35c98a2dd7b5e5f8dc4a0b Mon Sep 17 00:00:00 2001
From: Martin Wilck <[email protected]>
Date: Thu, 9 May 2019 23:49:53 +0200
Subject: [PATCH 16/18] extension.js: fix indentation after previous change

Patch "Port non-GObject class to JS6" introduced indentation
problems. Fix them.
---
 extension/extension.js | 284 ++++++++++++++++++++---------------------
 1 file changed, 142 insertions(+), 142 deletions(-)

diff --git a/extension/extension.js b/extension/extension.js
index 3c84759..2d398c1 100644
--- a/extension/extension.js
+++ b/extension/extension.js
@@ -94,7 +94,7 @@ let WindowsProxy = 
Gio.DBusProxy.makeProxyWrapper(WindowsProxyIface);
  */
 class Controller {
     constructor(extensionMeta) {
-    let dateMenu = Main.panel.statusArea.dateMenu;
+       let dateMenu = Main.panel.statusArea.dateMenu;
 
         this.extensionMeta = extensionMeta;
         this.panelWidget = null;
@@ -107,161 +107,161 @@ class Controller {
         this.shouldEnable = false;
     }
 
-        /**
-         * 'Magic' method, called upon extension launch.
-         *
-         * The gnome-shell-extension API grantees that there is always a 
``disable`` call in
-         * between to ``enable`` calls.
-         *
-         * Note:
-         *  We only set up our dbus proxies here. In order to be able to do so 
asynchronously all
-         *  the actual startup code is refered to ``deferred_enable``.
-         */
-       enable() {
-            this.shouldEnable = true;
-            new ApiProxy(Gio.DBus.session, 'org.gnome.Hamster', 
'/org/gnome/Hamster',
-                function(proxy) {
-                    this.apiProxy = proxy;
-                    this.deferred_enable();
-                }.bind(this));
-            new WindowsProxy(Gio.DBus.session, 
"org.gnome.Hamster.WindowServer",
-                "/org/gnome/Hamster/WindowServer",
-                function(proxy) {
-                    this.windowsProxy = proxy;
-                    this.deferred_enable();
-                }.bind(this));
+    /**
+     * 'Magic' method, called upon extension launch.
+     *
+     * The gnome-shell-extension API grantees that there is always a 
``disable`` call in
+     * between to ``enable`` calls.
+     *
+     * Note:
+     *  We only set up our dbus proxies here. In order to be able to do so 
asynchronously all
+     *  the actual startup code is refered to ``deferred_enable``.
+     */
+    enable() {
+        this.shouldEnable = true;
+        new ApiProxy(Gio.DBus.session, 'org.gnome.Hamster', 
'/org/gnome/Hamster',
+                     function(proxy) {
+                        this.apiProxy = proxy;
+                        this.deferred_enable();
+                     }.bind(this));
+        new WindowsProxy(Gio.DBus.session, "org.gnome.Hamster.WindowServer",
+                        "/org/gnome/Hamster/WindowServer",
+                        function(proxy) {
+                            this.windowsProxy = proxy;
+                            this.deferred_enable();
+                        }.bind(this));
+    }
+
+    deferred_enable() {
+        // Make sure ``enable`` is 'finished' and ``disable`` has not been
+        // called in between.
+        if (!this.shouldEnable || !this.apiProxy || !this.windowsProxy)
+            return;
+
+        this.settings = ExtensionUtils.getSettings();
+        this.panelWidget = new PanelWidget(this);
+        this.placement = this.settings.get_int("panel-placement");
+
+        this._placeWidget(this.placement, this.panelWidget);
+
+        // Callbacks that handle appearing/vanishing dbus services.
+        function apiProxy_appeared_callback() {
         }
 
-        deferred_enable() {
-            // Make sure ``enable`` is 'finished' and ``disable`` has not been
-            // called in between.
-            if (!this.shouldEnable || !this.apiProxy || !this.windowsProxy)
-                return;
+        function apiProxy_vanished_callback() {
+           /* jshint validthis: true */
+            global.log(_("hamster-shell-extension: 'hamster-service' not 
running. Shutting down."));
+            Main.notify(_("hamster-shell-extension: 'hamster-service' not 
running. Shutting down."));
+            this.disable();
+        }
 
-            this.settings = ExtensionUtils.getSettings();
-            this.panelWidget = new PanelWidget(this);
-            this.placement = this.settings.get_int("panel-placement");
+        function windowsProxy_appeared_callback() {
+        }
 
-            this._placeWidget(this.placement, this.panelWidget);
+        function windowsProxy_vanished_callback() {
+           /* jshint validthis: true */
+            global.log(_("hamster-shell-extension: 'hamster-windows-service' 
not running. Shutting down."));
+            Main.notify(_("hamster-shell-extension: 'hamster-windows-service' 
not running. Shutting down."));
+            this.disable();
+        }
 
-            // Callbacks that handle appearing/vanishing dbus services.
-            function apiProxy_appeared_callback() {
-            }
+        // Set-up watchers that watch for required dbus services.
+        let dbus_watcher = Gio.bus_watch_name(Gio.BusType.SESSION, 
'org.gnome.Hamster',
+                                             Gio.BusNameWatcherFlags.NONE, 
apiProxy_appeared_callback.bind(this),
+                                             
apiProxy_vanished_callback.bind(this));
 
-            function apiProxy_vanished_callback() {
-               /* jshint validthis: true */
-                global.log(_("hamster-shell-extension: 'hamster-service' not 
running. Shutting down."));
-                Main.notify(_("hamster-shell-extension: 'hamster-service' not 
running. Shutting down."));
-                this.disable();
-            }
+        let dbus_watcher_window = Gio.bus_watch_name(Gio.BusType.SESSION, 
'org.gnome.Hamster.WindowServer',
+                                                    
Gio.BusNameWatcherFlags.NONE, windowsProxy_appeared_callback.bind(this),
+                                                    
windowsProxy_vanished_callback.bind(this));
 
-            function windowsProxy_appeared_callback() {
-            }
+        this.apiProxy.connectSignal('ActivitiesChanged', 
this.refreshActivities.bind(this));
+        this.refreshActivities();
 
-            function windowsProxy_vanished_callback() {
-               /* jshint validthis: true */
-                global.log(_("hamster-shell-extension: 
'hamster-windows-service' not running. Shutting down."));
-                Main.notify(_("hamster-shell-extension: 
'hamster-windows-service' not running. Shutting down."));
-                this.disable();
-            }
+        Main.panel.menuManager.addMenu(this.panelWidget.menu);
+        Main.wm.addKeybinding("show-hamster-dropdown",
+                             this.panelWidget._settings,
+                             Meta.KeyBindingFlags.NONE,
+                             // Since Gnome 3.16, Shell.KeyBindingMode is 
replaced by Shell.ActionMode
+                             Shell.KeyBindingMode ? Shell.KeyBindingMode.ALL : 
Shell.ActionMode.ALL,
+                             this.panelWidget.toggle.bind(this.panelWidget)
+                            );
+    }
 
-            // Set-up watchers that watch for required dbus services.
-            let dbus_watcher = Gio.bus_watch_name(Gio.BusType.SESSION, 
'org.gnome.Hamster',
-                Gio.BusNameWatcherFlags.NONE, 
apiProxy_appeared_callback.bind(this),
-                apiProxy_vanished_callback.bind(this));
+    disable() {
+        this.shouldEnable = false;
+        Main.wm.removeKeybinding("show-hamster-dropdown");
 
-            let dbus_watcher_window = Gio.bus_watch_name(Gio.BusType.SESSION, 
'org.gnome.Hamster.WindowServer',
-                Gio.BusNameWatcherFlags.NONE, 
windowsProxy_appeared_callback.bind(this),
-                windowsProxy_vanished_callback.bind(this));
+        global.log('Shutting down hamster-shell-extension.');
+        this._removeWidget(this.placement);
+        Main.panel.menuManager.removeMenu(this.panelWidget.menu);
+        this.panelWidget.destroy();
+        this.panelWidget = null;
+        this.apiProxy = null;
+        this.windowsProxy = null;
+    }
 
-            this.apiProxy.connectSignal('ActivitiesChanged', 
this.refreshActivities.bind(this));
-            this.refreshActivities();
+    /**
+     * Build a new cache of all activities present in the backend.
+     */
+    refreshActivities() {
+        if (this.runningActivitiesQuery) {
+            return(this.activities);
+        }
 
-            Main.panel.menuManager.addMenu(this.panelWidget.menu);
-            Main.wm.addKeybinding("show-hamster-dropdown",
-                this.panelWidget._settings,
-                Meta.KeyBindingFlags.NONE,
-                // Since Gnome 3.16, Shell.KeyBindingMode is replaced by 
Shell.ActionMode
-                Shell.KeyBindingMode ? Shell.KeyBindingMode.ALL : 
Shell.ActionMode.ALL,
-                                 this.panelWidget.toggle.bind(this.panelWidget)
+        this.runningActivitiesQuery = true;
+        this.apiProxy.GetActivitiesRemote("", function([response], err) {
+            this.runningActivitiesQuery = false;
+            this.activities = response;
+            global.log('ACTIVITIES HAMSTER: ', this.activities);
+        }.bind(this));
+    }
+
+    /**
+     * Place the actual extension wi
+     * get in the right place according to settings.
+     */
+    _placeWidget(placement, panelWidget) {
+        if (placement == 1) {
+            // 'Replace calendar'
+            Main.panel.addToStatusArea("hamster", this.panelWidget, 0, 
"center");
+
+            Main.panel._centerBox.remove_actor(dateMenu.container);
+            Main.panel._addToPanelBox('dateMenu', dateMenu, -1, 
Main.panel._rightBox);
+        } else if (placement == 2) {
+            // 'Replace activities'
+            let activitiesMenu = 
Main.panel._leftBox.get_children()[0].get_children()[0].get_children()[0].get_children()[0];
+            // If our widget replaces the 'Activities' menu in the panel,
+            // this property stores the original text so we can restore it
+            // on ``this.disable``.
+            this._activitiesText = activitiesMenu.get_text();
+            activitiesMenu.set_text('');
+            Main.panel.addToStatusArea("hamster", this.panelWidget, 1, "left");
+        } else {
+            // 'Default'
+            Main.panel.addToStatusArea("hamster", this.panelWidget, 0, 
"right");
+        }
+    }
+
+    _removeWidget(placement) {
+        if (placement == 1) {
+            // We replaced the calendar
+            Main.panel._rightBox.remove_actor(dateMenu.container);
+            Main.panel._addToPanelBox(
+                'dateMenu',
+                dateMenu,
+                Main.sessionMode.panel.center.indexOf('dateMenu'),
+                Main.panel._centerBox
             );
+            Main.panel._centerBox.remove_actor(this.panelWidget.container);
+        } else if (placement == 2) {
+            // We replaced the 'Activities' menu
+            let activitiesMenu = 
Main.panel._leftBox.get_children()[0].get_children()[0].get_children()[0].get_children()[0];
+            activitiesMenu.set_text(this._activitiesText);
+            Main.panel._leftBox.remove_actor(this.panelWidget.container);
+        } else {
+            Main.panel._rightBox.remove_actor(this.panelWidget.container);
         }
-
-        disable() {
-            this.shouldEnable = false;
-            Main.wm.removeKeybinding("show-hamster-dropdown");
-
-            global.log('Shutting down hamster-shell-extension.');
-            this._removeWidget(this.placement);
-            Main.panel.menuManager.removeMenu(this.panelWidget.menu);
-            this.panelWidget.destroy();
-            this.panelWidget = null;
-            this.apiProxy = null;
-            this.windowsProxy = null;
-        }
-
-        /**
-         * Build a new cache of all activities present in the backend.
-         */
-        refreshActivities() {
-                if (this.runningActivitiesQuery) {
-                    return(this.activities);
-                }
-
-                this.runningActivitiesQuery = true;
-                this.apiProxy.GetActivitiesRemote("", function([response], 
err) {
-                  this.runningActivitiesQuery = false;
-                  this.activities = response;
-                  global.log('ACTIVITIES HAMSTER: ', this.activities);
-                }.bind(this));
-        }
-
-        /**
-         * Place the actual extension wi
-         * get in the right place according to settings.
-         */
-        _placeWidget(placement, panelWidget) {
-            if (placement == 1) {
-                // 'Replace calendar'
-                Main.panel.addToStatusArea("hamster", this.panelWidget, 0, 
"center");
-
-                Main.panel._centerBox.remove_actor(dateMenu.container);
-                Main.panel._addToPanelBox('dateMenu', dateMenu, -1, 
Main.panel._rightBox);
-            } else if (placement == 2) {
-                // 'Replace activities'
-                let activitiesMenu = 
Main.panel._leftBox.get_children()[0].get_children()[0].get_children()[0].get_children()[0];
-                // If our widget replaces the 'Activities' menu in the panel,
-                // this property stores the original text so we can restore it
-                // on ``this.disable``.
-                this._activitiesText = activitiesMenu.get_text();
-                activitiesMenu.set_text('');
-                Main.panel.addToStatusArea("hamster", this.panelWidget, 1, 
"left");
-            } else {
-                // 'Default'
-                Main.panel.addToStatusArea("hamster", this.panelWidget, 0, 
"right");
-            }
-        }
-
-        _removeWidget(placement) {
-            if (placement == 1) {
-                // We replaced the calendar
-                Main.panel._rightBox.remove_actor(dateMenu.container);
-                Main.panel._addToPanelBox(
-                    'dateMenu',
-                    dateMenu,
-                    Main.sessionMode.panel.center.indexOf('dateMenu'),
-                    Main.panel._centerBox
-                );
-                Main.panel._centerBox.remove_actor(this.panelWidget.container);
-            } else if (placement == 2) {
-                // We replaced the 'Activities' menu
-                let activitiesMenu = 
Main.panel._leftBox.get_children()[0].get_children()[0].get_children()[0].get_children()[0];
-                activitiesMenu.set_text(this._activitiesText);
-                Main.panel._leftBox.remove_actor(this.panelWidget.container);
-            } else {
-                Main.panel._rightBox.remove_actor(this.panelWidget.container);
-            }
-        }
+    }
 }
 
 
-- 
2.21.0

++++++ 0017-Don-t-log-ACTIVITIES-at-every-refresh.patch ++++++
>From e40ec94eeebea0bd3bd25f5aeb102f3071dba833 Mon Sep 17 00:00:00 2001
From: Martin Wilck <[email protected]>
Date: Thu, 9 May 2019 23:53:41 +0200
Subject: [PATCH 17/18] Don't log ACTIVITIES at every refresh

---
 extension/extension.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/extension/extension.js b/extension/extension.js
index 2d398c1..4956c47 100644
--- a/extension/extension.js
+++ b/extension/extension.js
@@ -212,7 +212,7 @@ class Controller {
         this.apiProxy.GetActivitiesRemote("", function([response], err) {
             this.runningActivitiesQuery = false;
             this.activities = response;
-            global.log('ACTIVITIES HAMSTER: ', this.activities);
+            // global.log('ACTIVITIES HAMSTER: ', this.activities);
         }.bind(this));
     }
 
-- 
2.21.0

++++++ 0018-doc-remove-broken-link-to-usejsdoc.org.patch ++++++
>From 0fc670a1bfe83e2e2b4e96c3e172557227a71b6f Mon Sep 17 00:00:00 2001
From: Martin Wilck <[email protected]>
Date: Fri, 10 May 2019 00:35:27 +0200
Subject: [PATCH 18/18] doc: remove broken link to usejsdoc.org

The site seems to be down, and no obvious replacement exists.
This breaks the CI.
---
 docs/styleguide.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/styleguide.rst b/docs/styleguide.rst
index f96cdf4..bc5f0e3 100644
--- a/docs/styleguide.rst
+++ b/docs/styleguide.rst
@@ -31,7 +31,7 @@ Code-style
 
 Documentation
 ---------------
-- We use `JSDoc syntax and blog tags <http://usejsdoc.org>`_ to document all
+- We use JSDoc syntax and blog tags to document all
   our code.
 - Headings should capitalise each word.
 - Please use ``-`` for unordered lists and ``#.`` for ordered lists unless you
-- 
2.21.0


Reply via email to