diff options
author | Marcus Lundblad <ml@update.uu.se> | 2017-11-20 21:27:49 +0100 |
---|---|---|
committer | Marcus Lundblad <ml@update.uu.se> | 2018-02-05 22:10:13 +0100 |
commit | acff05f0835ad1a228c1b0dc3ec5a7395fe028da (patch) | |
tree | ecd54fd2c8be7636a33f287b4502bf11a1f0c91e /src/osmTypeListRow.js | |
parent | 173ae448f43976e8e0da7ece43500b48615c61fc (diff) | |
download | gnome-maps-acff05f0835ad1a228c1b0dc3ec5a7395fe028da.tar.gz |
Use ES6 classes
Replace the usage of legacy Lang.Class.
Register classes that needs GObject
functionallity using GObject.registerClass(),
use straight ES6 classes when GObject is not
nessesary.
https://bugzilla.gnome.org/show_bug.cgi?id=722758
Diffstat (limited to 'src/osmTypeListRow.js')
-rw-r--r-- | src/osmTypeListRow.js | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/osmTypeListRow.js b/src/osmTypeListRow.js index 56229cc5..795d203c 100644 --- a/src/osmTypeListRow.js +++ b/src/osmTypeListRow.js @@ -19,31 +19,30 @@ * Author: Marcus Lundblad <ml@update.uu.se> */ +const GObject = imports.gi.GObject; const Gtk = imports.gi.Gtk; -const Lang = imports.lang; -var OSMTypeListRow = new Lang.Class({ - Name: 'OSMTypeListRow', - Extends: Gtk.ListBoxRow, +var OSMTypeListRow = GObject.registerClass({ Template: 'resource:///org/gnome/Maps/ui/osm-type-list-row.ui', - InternalChildren: [ 'name' ], + InternalChildren: [ 'name' ] +}, class OSMTypeListRow extends Gtk.ListBoxRow { - _init: function(props) { + _init(props) { this._type = props.type; delete props.type; - this.parent(props); + super._init(props); this._name.label = this._type.title; - }, + } get key() { return this._type.key; - }, + } get value() { return this._type.value; - }, + } get title() { return this._type.title; |