[gnome-characters/cherry-pick-5d508928: 3/3] searchProvider: Fix deprecation fixes



commit cbe9939011a700a3aa288341b24f880888cc92ba
Author: Jan Alexander Steffens (heftig) <jan steffens gmail com>
Date:   Wed Mar 20 21:07:01 2019 +0000

    searchProvider: Fix deprecation fixes
    
    - `ByteArray` did not get imported and was missing.
    - `String.prototype.toUpperCase` cannot be passed directly to `map`.
    
    Fixes https://gitlab.gnome.org/GNOME/gnome-characters/issues/49
    
    
    (cherry picked from commit 5d5089285d93b5aa9bda5990bbc5586acd620a7b)

 src/searchProvider.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/searchProvider.js b/src/searchProvider.js
index efe776f..5b50864 100644
--- a/src/searchProvider.js
+++ b/src/searchProvider.js
@@ -19,6 +19,7 @@
 
 const {Gc, Gdk, Gio, GLib, GObject} = imports.gi;
 
+const ByteArray = imports.byteArray;
 const Service = imports.service;
 const Util = imports.util;
 
@@ -48,7 +49,7 @@ var SearchProvider = GObject.registerClass({
         this._cancellable.cancel();
         this._cancellable.reset();
 
-        let upper = keywords.map(String.prototype.toUpperCase);
+        let upper = keywords.map(x => x.toUpperCase());
         let criteria = Gc.SearchCriteria.new_keywords(upper);
         let context = new Gc.SearchContext({ criteria: criteria,
                                              flags: Gc.SearchFlag.WORD });
@@ -154,4 +155,4 @@ var SearchProvider = GObject.registerClass({
         this._activateAction('search', new GLib.Variant('as', terms),
                              timestamp);
     }
-});
\ No newline at end of file
+});


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