diff --git a/scripts/extractPoiTypesFromID.js b/scripts/extractPoiTypesFromID.js index b115553..10689f0 100755 --- a/scripts/extractPoiTypesFromID.js +++ b/scripts/extractPoiTypesFromID.js @@ -30,7 +30,6 @@ */ const Gio = imports.gi.Gio; -const ByteArray = imports.byteArray; const PRESETS_PATH = 'data/presets/presets'; const LOCALES_PATH = 'dist/locales'; @@ -83,7 +82,7 @@ function processLocale(dirPath, fileName) { let file = Gio.File.new_for_path(dirPath + '/' + fileName); let [status, buffer] = file.load_contents(null); - let object = JSON.parse(ByteArray.toString(buffer)); + let object = JSON.parse(buffer); let lang = fileName.substring(0, fileName.indexOf('.json')); for (let type in OUTPUT) { diff --git a/src/geoJSONShapeLayer.js b/src/geoJSONShapeLayer.js index d06fe94..46dcc47 100644 --- a/src/geoJSONShapeLayer.js +++ b/src/geoJSONShapeLayer.js @@ -18,7 +18,6 @@ */ const GObject = imports.gi.GObject; -const ByteArray = imports.byteArray; const GeoJSONSource = imports.geoJSONSource; const ShapeLayer = imports.shapeLayer; @@ -45,7 +44,7 @@ } _parseContent() { - this._mapSource.parse(JSON.parse(ByteArray.toString(this._fileContents))); + this._mapSource.parse(JSON.parse(this._fileContents)); } }); diff --git a/src/osmTypes.js b/src/osmTypes.js index 8e95530..40980c6 100644 --- a/src/osmTypes.js +++ b/src/osmTypes.js @@ -21,7 +21,6 @@ const Gio = imports.gi.Gio; const GLib = imports.gi.GLib; -const ByteArray = imports.byteArray; const Utils = imports.utils; @@ -30,7 +29,7 @@ const _file = Gio.file_new_for_uri('resource://org/gnome/Maps/osm-types.json'); const [_status, _buffer] = _file.load_contents(null); -const OSM_TYPE_MAP = JSON.parse(ByteArray.toString(_buffer)); +const OSM_TYPE_MAP = JSON.parse(_buffer); /* Lists the OSM tags we base our notion of location types on */ var OSM_TYPE_TAGS = ['aeroway', 'amenity', 'leisure', 'office', 'place', 'shop', 'tourism' ]; @@ -129,7 +128,7 @@ return; } - this._recentTypes = JSON.parse(ByteArray.toString(buffer)); + this._recentTypes = JSON.parse(buffer); } _save() { diff --git a/src/placeStore.js b/src/placeStore.js index 7c240ae..7b3abc7 100644 --- a/src/placeStore.js +++ b/src/placeStore.js @@ -22,7 +22,6 @@ const GdkPixbuf = imports.gi.GdkPixbuf; const Geocode = imports.gi.GeocodeGlib; const Gtk = imports.gi.Gtk; -const ByteArray = imports.byteArray; const ContactPlace = imports.contactPlace; const Place = imports.place; @@ -166,7 +165,7 @@ if (buffer === null) return; try { - let jsonArray = JSON.parse(ByteArray.toString(buffer)); + let jsonArray = JSON.parse(buffer); jsonArray.forEach(({ place, type, added }) => { // We expect exception to be thrown in this line when parsing // gnome-maps 3.14 or below place stores since the "place" diff --git a/src/service.js b/src/service.js index c1f5413..cf0654c 100644 --- a/src/service.js +++ b/src/service.js @@ -22,7 +22,6 @@ const Gio = imports.gi.Gio; const GLib = imports.gi.GLib; const Soup = imports.gi.Soup; -const ByteArray = imports.byteArray; const Utils = imports.utils; @@ -37,7 +36,7 @@ log('Failed to open service file: ' + filename); System.exit(1); } - _service = JSON.parse(ByteArray.toString(data)); + _service = JSON.parse(data); return _service; }