js: Use gjs-defined GObject accessors where possible

Nowadays gjs allows to omit get/set accessors for read-write properties,
and will define reasonable defaults in that case. In many cases we don't
need anything more than the default handling, let gjs handle those props.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1611>
This commit is contained in:
Florian Müllner
2021-01-30 01:03:04 +01:00
parent a41e294e21
commit 0f1b566918
5 changed files with 68 additions and 371 deletions

View File

@ -369,7 +369,6 @@ var Notification = GObject.registerClass({
this.isTransient = false;
this.privacyScope = PrivacyScope.USER;
this.forFeedback = false;
this._acknowledged = false;
this.bannerBodyText = null;
this.bannerBodyMarkup = false;
this._soundName = null;
@ -438,17 +437,6 @@ var Notification = GObject.registerClass({
this.actions.push({ label, callback });
}
get acknowledged() {
return this._acknowledged;
}
set acknowledged(v) {
if (this._acknowledged == v)
return;
this._acknowledged = v;
this.notify('acknowledged');
}
setUrgency(urgency) {
this.urgency = urgency;
}