Use constructor in GObject classes

This commit is contained in:
Romain Vigier
2022-02-18 13:24:25 +01:00
parent a407981ce5
commit 2faad1e9af
5 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -15,8 +15,8 @@ var BackgroundsPage = GObject.registerClass({
'night_button',
],
}, class BackgroundsPage extends Adw.PreferencesPage {
_init(props = {}) {
super._init(props);
constructor(props = {}) {
super(props);
const settings = new Gio.Settings({ schema: 'org.gnome.desktop.background' });
settings.bind('picture-uri', this._day_button, 'path', Gio.SettingsBindFlags.DEFAULT);
+2 -2
View File
@@ -18,8 +18,8 @@ var CommandsPage = GObject.registerClass({
'sunset_entry',
],
}, class CommandsPage extends Adw.PreferencesPage {
_init(props = {}) {
super._init(props);
constructor(props = {}) {
super(props);
const settings = extensionUtils.getSettings(utils.getSettingsSchema('commands'));
settings.bind('enabled', this._enabled_switch, 'active', Gio.SettingsBindFlags.DEFAULT);
+2 -2
View File
@@ -29,8 +29,8 @@ var SchedulePage = GObject.registerClass({
'ondemand_preferences_group',
],
}, class SchedulePage extends Adw.PreferencesPage {
_init(props = {}) {
super._init(props);
constructor(props = {}) {
super(props);
const settings = extensionUtils.getSettings(utils.getSettingsSchema('time'));
const colorSettings = new Gio.Settings({ schema: 'org.gnome.settings-daemon.plugins.color' });
const locationSettings = new Gio.Settings({ schema: 'org.gnome.system.location' });
+2 -2
View File
@@ -30,8 +30,8 @@ var ThemesPage = GObject.registerClass({
'cursor_night_variant_combo_row',
],
}, class ThemesPage extends Adw.PreferencesPage {
_init(props = {}) {
super._init(props);
constructor(props = {}) {
super(props);
const gtkSettings = extensionUtils.getSettings(utils.getSettingsSchema('gtk-variants'));
const shellSettings = extensionUtils.getSettings(utils.getSettingsSchema('shell-variants'));
const iconSettings = extensionUtils.getSettings(utils.getSettingsSchema('icon-variants'));