GNOME Bugzilla – Bug 671556
networkAgent: Fix external-ui dialogs
Last modified: 2012-03-19 19:41:26 UTC
See patch.
Created attachment 209160 [details] [review] networkAgent: Fix external-ui dialogs Two small fixes which made _showNewStyleDialog() err out: - g_key_file_load_from_data() expects a string as first argument, but g_buffered_input_stream_peek_buffer() returns an array of "data" - g_key_file_load_from_data() is documented to allow -1 as length parameter for \0-terminated strings, but the actual type of the parameter is unsigned (d'uh)
Review of attachment 209160 [details] [review]: Works. Thanks a lot!
Review of attachment 209160 [details] [review]: ::: js/ui/networkAgent.js @@ +529,3 @@ try { + let data = this._dataStdout.peek_buffer().toString(); + keyfile.load_from_data(data, data.length, GLib.KeyFileFlags.NONE); This is wrong. data.length is the number of (UTF-16) characters, but you want the number of bytes.
Created attachment 209208 [details] [review] networkAgent: Fix external-ui dialogs (In reply to comment #3) > Review of attachment 209160 [details] [review]: > > ::: js/ui/networkAgent.js > This is wrong. data.length is the number of (UTF-16) characters, but you want > the number of bytes. Hmm, right. Doesn't make it easier that we actually need the number of bytes of the UTF-8 string which is the result of the conversion from UTF-16 ... Updated patch should work while sidestepping the conversion craziness (at least I did not encounter any problems when testing with some non-Latin locales).
Giovanni, can you re-review this? I don't want to have VPN dialogs broken for 3.4.
Review of attachment 209208 [details] [review]: Yes, this works. (sorry, I didn't see the updated patch because I forgot to set CC)
Attachment 209208 [details] pushed as bf42831 - networkAgent: Fix external-ui dialogs