After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 671556 - networkAgent: Fix external-ui dialogs
networkAgent: Fix external-ui dialogs
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-03-07 13:53 UTC by Florian Müllner
Modified: 2012-03-19 19:41 UTC
See Also:
GNOME target: 3.4
GNOME version: 3.3/3.4


Attachments
networkAgent: Fix external-ui dialogs (1.39 KB, patch)
2012-03-07 13:53 UTC, Florian Müllner
reviewed Details | Review
networkAgent: Fix external-ui dialogs (1.29 KB, patch)
2012-03-07 19:56 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2012-03-07 13:53:51 UTC
See patch.
Comment 1 Florian Müllner 2012-03-07 13:53:54 UTC
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)
Comment 2 Matthias Clasen 2012-03-07 13:58:05 UTC
Review of attachment 209160 [details] [review]:

Works. Thanks a lot!
Comment 3 Giovanni Campagna 2012-03-07 18:10:08 UTC
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.
Comment 4 Florian Müllner 2012-03-07 19:56:04 UTC
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).
Comment 5 Jasper St. Pierre (not reading bugmail) 2012-03-18 01:20:58 UTC
Giovanni, can you re-review this? I don't want to have VPN dialogs broken for 3.4.
Comment 6 Giovanni Campagna 2012-03-19 18:34:34 UTC
Review of attachment 209208 [details] [review]:

Yes, this works.

(sorry, I didn't see the updated patch because I forgot to set CC)
Comment 7 Florian Müllner 2012-03-19 19:41:21 UTC
Attachment 209208 [details] pushed as bf42831 - networkAgent: Fix external-ui dialogs