[gnome-weather/gnome-3-32] searchProvider: Fix a warning



commit adf7e0a049008e02d64aae0de24edb06992892ec
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Apr 8 02:56:00 2019 +0200

    searchProvider: Fix a warning
    
    Since gjs 1.54, the native Uint8Array type is used for raw data returned
    from introspected functions instead of the custom ByteArray type. For
    now gjs overrides Uint8Array's native toString() implementation, which
    represents the array as comma-separated digits, with an implementation
    that is compatible with the previously used ByteArray, but warns about
    the deprecated usage.
    
    Fix that warning by using the recommended replacement.
    
    https://gitlab.gnome.org/GNOME/gnome-weather/merge_requests/18

 src/service/searchProvider.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/service/searchProvider.js b/src/service/searchProvider.js
index 9954d4f..296b8a6 100644
--- a/src/service/searchProvider.js
+++ b/src/service/searchProvider.js
@@ -16,6 +16,7 @@
 // with Gnome Weather; if not, write to the Free Software Foundation,
 // Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
+const ByteArray = imports.byteArray;
 const Gio = imports.gi.Gio;
 const GLib = imports.gi.GLib;
 const GWeather = imports.gi.GWeather;
@@ -24,7 +25,7 @@ const Lang = imports.lang;
 const Util = imports.misc.util;
 const World = imports.shared.world;
 
-const SearchProviderInterface = Gio.resources_lookup_data('/org/gnome/shell/ShellSearchProvider2.xml', 
0).toArray().toString();
+const SearchProviderInterface = 
ByteArray.toString(Gio.resources_lookup_data('/org/gnome/shell/ShellSearchProvider2.xml', 0).get_data());
 
 function getCountryName(location) {
     while (location &&


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]