[gnome-characters] Don't try to calculate character length in UTF-8
- From: Daiki Ueno <dueno src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-characters] Don't try to calculate character length in UTF-8
- Date: Tue, 15 Dec 2015 07:07:55 +0000 (UTC)
commit e3767830f4cf2c98b35e806194f755cbff4813b9
Author: Daiki Ueno <dueno src gnome org>
Date: Tue Dec 15 16:02:17 2015 +0900
Don't try to calculate character length in UTF-8
Since GLib.unichar_to_utf8() is not callble from Gjs anymore, just pass
-1 to Gtk.Clipboard.set_text().
src/character.js | 7 +------
src/searchProvider.js | 6 +-----
2 files changed, 2 insertions(+), 11 deletions(-)
---
diff --git a/src/character.js b/src/character.js
index 8c25102..bd01eed 100644
--- a/src/character.js
+++ b/src/character.js
@@ -160,12 +160,7 @@ const CharacterDialog = new Lang.Class({
Lang.bind(this,
this._clipboardOwnerChanged));
}
-
- // FIXME: GLib.unichar_to_utf8() has missing (nullable)
- // annotation to the outbuf argument.
- let outbuf = ' ';
- let length = GLib.unichar_to_utf8(this._character, outbuf);
- this._clipboard.set_text(this._character, length);
+ this._clipboard.set_text(this._character, -1);
// Show a feedback message with a revealer. The message is
// hidden after 2 seconds, or when another client set a
diff --git a/src/searchProvider.js b/src/searchProvider.js
index 90346e7..c5ab4ab 100644
--- a/src/searchProvider.js
+++ b/src/searchProvider.js
@@ -111,11 +111,7 @@ const SearchProvider = new Lang.Class({
ActivateResult: function(id, terms, timestamp) {
let clipboard = Gc.gtk_clipboard_get();
- // FIXME: GLib.unichar_to_utf8() has missing (nullable)
- // annotation to the outbuf argument.
- let outbuf = ' ';
- let length = GLib.unichar_to_utf8(id, outbuf);
- clipboard.set_text(id, length);
+ clipboard.set_text(id, -1);
},
_getPlatformData: function(timestamp) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]