Codebase list gnome-maps / 42a17aa
Revert "Fix warnings about using Uint8Array.toString()" This reverts commit 95f28f0d514eeeeff7aefedd41db4716ffbbd0ce. Marcus Lundblad 5 years ago
5 changed file(s) with 6 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
2929 */
3030
3131 const Gio = imports.gi.Gio;
32 const ByteArray = imports.byteArray;
3332
3433 const PRESETS_PATH = 'data/presets/presets';
3534 const LOCALES_PATH = 'dist/locales';
8281 function processLocale(dirPath, fileName) {
8382 let file = Gio.File.new_for_path(dirPath + '/' + fileName);
8483 let [status, buffer] = file.load_contents(null);
85 let object = JSON.parse(ByteArray.toString(buffer));
84 let object = JSON.parse(buffer);
8685 let lang = fileName.substring(0, fileName.indexOf('.json'));
8786
8887 for (let type in OUTPUT) {
1717 */
1818
1919 const GObject = imports.gi.GObject;
20 const ByteArray = imports.byteArray;
2120
2221 const GeoJSONSource = imports.geoJSONSource;
2322 const ShapeLayer = imports.shapeLayer;
4443 }
4544
4645 _parseContent() {
47 this._mapSource.parse(JSON.parse(ByteArray.toString(this._fileContents)));
46 this._mapSource.parse(JSON.parse(this._fileContents));
4847 }
4948 });
5049
2020
2121 const Gio = imports.gi.Gio;
2222 const GLib = imports.gi.GLib;
23 const ByteArray = imports.byteArray;
2423
2524 const Utils = imports.utils;
2625
2928
3029 const _file = Gio.file_new_for_uri('resource://org/gnome/Maps/osm-types.json');
3130 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);
3332
3433 /* Lists the OSM tags we base our notion of location types on */
3534 var OSM_TYPE_TAGS = ['aeroway', 'amenity', 'leisure', 'office', 'place', 'shop', 'tourism' ];
128127 return;
129128 }
130129
131 this._recentTypes = JSON.parse(ByteArray.toString(buffer));
130 this._recentTypes = JSON.parse(buffer);
132131 }
133132
134133 _save() {
2121 const GdkPixbuf = imports.gi.GdkPixbuf;
2222 const Geocode = imports.gi.GeocodeGlib;
2323 const Gtk = imports.gi.Gtk;
24 const ByteArray = imports.byteArray;
2524
2625 const ContactPlace = imports.contactPlace;
2726 const Place = imports.place;
165164 if (buffer === null)
166165 return;
167166 try {
168 let jsonArray = JSON.parse(ByteArray.toString(buffer));
167 let jsonArray = JSON.parse(buffer);
169168 jsonArray.forEach(({ place, type, added }) => {
170169 // We expect exception to be thrown in this line when parsing
171170 // gnome-maps 3.14 or below place stores since the "place"
2121 const Gio = imports.gi.Gio;
2222 const GLib = imports.gi.GLib;
2323 const Soup = imports.gi.Soup;
24 const ByteArray = imports.byteArray;
2524
2625 const Utils = imports.utils;
2726
3635 log('Failed to open service file: ' + filename);
3736 System.exit(1);
3837 }
39 _service = JSON.parse(ByteArray.toString(data));
38 _service = JSON.parse(data);
4039 return _service;
4140 }
4241