Revert "Fix warnings about using Uint8Array.toString()"
This reverts commit 95f28f0d514eeeeff7aefedd41db4716ffbbd0ce.
Marcus Lundblad
5 years ago
29 | 29 |
*/
|
30 | 30 |
|
31 | 31 |
const Gio = imports.gi.Gio;
|
32 | |
const ByteArray = imports.byteArray;
|
33 | 32 |
|
34 | 33 |
const PRESETS_PATH = 'data/presets/presets';
|
35 | 34 |
const LOCALES_PATH = 'dist/locales';
|
|
82 | 81 |
function processLocale(dirPath, fileName) {
|
83 | 82 |
let file = Gio.File.new_for_path(dirPath + '/' + fileName);
|
84 | 83 |
let [status, buffer] = file.load_contents(null);
|
85 | |
let object = JSON.parse(ByteArray.toString(buffer));
|
|
84 |
let object = JSON.parse(buffer);
|
86 | 85 |
let lang = fileName.substring(0, fileName.indexOf('.json'));
|
87 | 86 |
|
88 | 87 |
for (let type in OUTPUT) {
|
17 | 17 |
*/
|
18 | 18 |
|
19 | 19 |
const GObject = imports.gi.GObject;
|
20 | |
const ByteArray = imports.byteArray;
|
21 | 20 |
|
22 | 21 |
const GeoJSONSource = imports.geoJSONSource;
|
23 | 22 |
const ShapeLayer = imports.shapeLayer;
|
|
44 | 43 |
}
|
45 | 44 |
|
46 | 45 |
_parseContent() {
|
47 | |
this._mapSource.parse(JSON.parse(ByteArray.toString(this._fileContents)));
|
|
46 |
this._mapSource.parse(JSON.parse(this._fileContents));
|
48 | 47 |
}
|
49 | 48 |
});
|
50 | 49 |
|
20 | 20 |
|
21 | 21 |
const Gio = imports.gi.Gio;
|
22 | 22 |
const GLib = imports.gi.GLib;
|
23 | |
const ByteArray = imports.byteArray;
|
24 | 23 |
|
25 | 24 |
const Utils = imports.utils;
|
26 | 25 |
|
|
29 | 28 |
|
30 | 29 |
const _file = Gio.file_new_for_uri('resource://org/gnome/Maps/osm-types.json');
|
31 | 30 |
const [_status, _buffer] = _file.load_contents(null);
|
32 | |
const OSM_TYPE_MAP = JSON.parse(ByteArray.toString(_buffer));
|
|
31 |
const OSM_TYPE_MAP = JSON.parse(_buffer);
|
33 | 32 |
|
34 | 33 |
/* Lists the OSM tags we base our notion of location types on */
|
35 | 34 |
var OSM_TYPE_TAGS = ['aeroway', 'amenity', 'leisure', 'office', 'place', 'shop', 'tourism' ];
|
|
128 | 127 |
return;
|
129 | 128 |
}
|
130 | 129 |
|
131 | |
this._recentTypes = JSON.parse(ByteArray.toString(buffer));
|
|
130 |
this._recentTypes = JSON.parse(buffer);
|
132 | 131 |
}
|
133 | 132 |
|
134 | 133 |
_save() {
|
21 | 21 |
const GdkPixbuf = imports.gi.GdkPixbuf;
|
22 | 22 |
const Geocode = imports.gi.GeocodeGlib;
|
23 | 23 |
const Gtk = imports.gi.Gtk;
|
24 | |
const ByteArray = imports.byteArray;
|
25 | 24 |
|
26 | 25 |
const ContactPlace = imports.contactPlace;
|
27 | 26 |
const Place = imports.place;
|
|
165 | 164 |
if (buffer === null)
|
166 | 165 |
return;
|
167 | 166 |
try {
|
168 | |
let jsonArray = JSON.parse(ByteArray.toString(buffer));
|
|
167 |
let jsonArray = JSON.parse(buffer);
|
169 | 168 |
jsonArray.forEach(({ place, type, added }) => {
|
170 | 169 |
// We expect exception to be thrown in this line when parsing
|
171 | 170 |
// gnome-maps 3.14 or below place stores since the "place"
|
21 | 21 |
const Gio = imports.gi.Gio;
|
22 | 22 |
const GLib = imports.gi.GLib;
|
23 | 23 |
const Soup = imports.gi.Soup;
|
24 | |
const ByteArray = imports.byteArray;
|
25 | 24 |
|
26 | 25 |
const Utils = imports.utils;
|
27 | 26 |
|
|
36 | 35 |
log('Failed to open service file: ' + filename);
|
37 | 36 |
System.exit(1);
|
38 | 37 |
}
|
39 | |
_service = JSON.parse(ByteArray.toString(data));
|
|
38 |
_service = JSON.parse(data);
|
40 | 39 |
return _service;
|
41 | 40 |
}
|
42 | 41 |
|