cleanup: Remove old compatibility code

Since gjs moved to mozjs60, return values of int8_t arrays can
no longer be treated as strings. We originally made the conversion
conditional to keep working with the (then) stable gjs release.

That was two years ago and we require a more recent gjs nowadays,
so there's no good reason for keeping the old code path.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1407
This commit is contained in:
Florian Müllner
2020-08-13 23:35:27 +02:00
committed by Georges Basile Stavracas Neto
parent 923d926345
commit 112b139a9e
5 changed files with 10 additions and 15 deletions

View File

@ -2,6 +2,7 @@
/* exported KeyboardManager */
const { Clutter, Gio, GLib, GObject, Meta, St } = imports.gi;
const ByteArray = imports.byteArray;
const Signals = imports.signals;
const InputSourceManager = imports.ui.status.keyboard;
@ -532,8 +533,7 @@ var KeyboardModel = class {
_loadModel(groupName) {
let file = Gio.File.new_for_uri('resource:///org/gnome/shell/osk-layouts/%s.json'.format(groupName));
let [success_, contents] = file.load_contents(null);
if (contents instanceof Uint8Array)
contents = imports.byteArray.toString(contents);
contents = ByteArray.toString(contents);
return JSON.parse(contents);
}