[gnome-maps] Revert "Fix warnings about using Uint8Array.toString()"
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] Revert "Fix warnings about using Uint8Array.toString()"
- Date: Thu, 29 Nov 2018 22:01:39 +0000 (UTC)
commit 42a17aa692d3136b036a8cd4f506d2dfbc5959a2
Author: Marcus Lundblad <ml update uu se>
Date: Thu Nov 29 23:00:56 2018 +0100
Revert "Fix warnings about using Uint8Array.toString()"
This reverts commit 95f28f0d514eeeeff7aefedd41db4716ffbbd0ce.
scripts/extractPoiTypesFromID.js | 3 +--
src/geoJSONShapeLayer.js | 3 +--
src/osmTypes.js | 5 ++---
src/placeStore.js | 3 +--
src/service.js | 3 +--
5 files changed, 6 insertions(+), 11 deletions(-)
---
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 processTypes(basePath) {
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 @@ class GeoJSONShapeLayer extends ShapeLayer.ShapeLayer {
}
_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 _NUM_RECENT_TYPES = 10;
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 @@ var RecentTypesStore = class RecentTypesStore {
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 GObject = imports.gi.GObject;
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 @@ class PlaceStore extends Gtk.ListStore {
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 @@ function _getServiceFromFile(filename) {
log('Failed to open service file: ' + filename);
System.exit(1);
}
- _service = JSON.parse(ByteArray.toString(data));
+ _service = JSON.parse(data);
return _service;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]