main: Instantiate EndSessionDialog

Using an exported `init()` function to create the object is an odd
pattern, and not having the object referenced anywhere makes it harder
to access for debugging or extensions.

Just export the `EndSessionDialog` class and instantiate it like we
do for other objects.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2997>
This commit is contained in:
Charles Wong
2023-10-28 15:34:36 +08:00
committed by Marge Bot
parent f4c9489585
commit 6ff08fd9bd
2 changed files with 3 additions and 9 deletions

View File

@ -223,14 +223,7 @@ function _setCheckBoxLabel(checkBox, text) {
}
}
export function init() {
// This always returns the same singleton object
// By instantiating it initially, we register the
// bus object, etc.
new EndSessionDialog();
}
const EndSessionDialog = GObject.registerClass(
export const EndSessionDialog = GObject.registerClass(
class EndSessionDialog extends ModalDialog.ModalDialog {
_init() {
super._init({