Refactor: Move GObject.registerClass calls into static init. blocks

Do that since it standardizes the code and also is just cleaner.
This commit is contained in:
June 2023-10-04 03:56:33 +02:00
commit 5ea8f4aabe
No known key found for this signature in database
GPG key ID: 094C2AC34192FA11
4 changed files with 54 additions and 46 deletions

View file

@ -10,11 +10,15 @@ import * as Main from "resource:///org/gnome/shell/ui/main.js";
* what is really useable by the other extension code.
* It's basically a heavy wrapper around the box orders stored in the settings.
*/
const BoxOrderManager = GObject.registerClass({
Signals: {
"appIndicatorReady": {}
export default class BoxOrderManager extends GObject.Object {
static {
GObject.registerClass({
Signals: {
"appIndicatorReady": {}
}
}, this);
}
}, class BoxOrderManager extends GObject.Object {
#appIndicatorReadyHandlerIdMap;
#appIndicatorItemApplicationRoleMap;
#settings;
@ -267,6 +271,4 @@ const BoxOrderManager = GObject.registerClass({
saveBoxOrderToSettings(boxOrders.center, "center");
saveBoxOrderToSettings(boxOrders.right, "right");
}
});
export default BoxOrderManager;
}