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 694651 - more libsecret porting
more libsecret porting
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: nm-applet
unspecified
Other All
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-02-25 07:59 UTC by Dan Winship
Modified: 2013-02-27 09:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
applet: free the GCancellables used with libsecret (1.08 KB, patch)
2013-02-25 07:59 UTC, Dan Winship
committed Details | Review
applet: belatedly port applet-device-broadband to libsecret (6.17 KB, patch)
2013-02-25 07:59 UTC, Dan Winship
committed Details | Review

Description Dan Winship 2013-02-25 07:59:03 UTC
see patches
Comment 1 Dan Winship 2013-02-25 07:59:05 UTC
Created attachment 237336 [details] [review]
applet: free the GCancellables used with libsecret
Comment 2 Dan Winship 2013-02-25 07:59:09 UTC
Created attachment 237337 [details] [review]
applet: belatedly port applet-device-broadband to libsecret

This code was added after the original libsecret port, and got missed
in the rebasing...
Comment 3 Dan Williams 2013-02-26 23:07:03 UTC
Review of attachment 237337 [details] [review]:

Something like this should fix it:

diff --git a/src/applet-device-broadband.c b/src/applet-device-broadband.c
index 55066bb..7f0e539 100644
--- a/src/applet-device-broadband.c
+++ b/src/applet-device-broadband.c
@@ -390,8 +390,7 @@ keyring_pin_check_cb (GObject *source,
 
                        /* Look for a matching "simid" attribute */
                        attributes = secret_item_get_attributes (item);
-                       simid = g_hash_table_lookup (attributes, "simid");
-                       if (g_strcmp0 (simid, info->simid))
+                       if (g_strcmp0 (simid, g_hash_table_lookup (attributes, "simid")))
                                pin = secret_item_get_secret (item);
                        else
                                pin = NULL;
@@ -684,7 +683,6 @@ add_connection_item (NMDevice *device,
        info->applet = applet;
        info->device = g_object_ref (G_OBJECT (device));
        info->connection = connection ? g_object_ref (connection) : NULL;
-       info->cancellable = g_cancellable_new ();
 
        g_signal_connect_data (item, "activate",
                               G_CALLBACK (menu_item_activate),

::: src/applet-device-broadband.c
@@ +392,3 @@
+			attributes = secret_item_get_attributes (item);
+			simid = g_hash_table_lookup (attributes, "simid");
+			if (g_strcmp0 (simid, info->simid))

This bit actually fails; 'simid' is already defined above as the modem's simid from ModemManager (via "simid = mm_sim_get_identifier()"), plus the simid isn't in 'info' either.  Needs to be something like:

if (g_strcmp0 (simid, g_hash_table_lookup (attributes, "simid")))

or use a temporary variable.

applet-device-broadband.c: In function ‘keyring_pin_check_cb’:
applet-device-broadband.c:394:30: error: ‘BroadbandDeviceInfo’ has no member named ‘simid’

@@ +685,3 @@
 	info->device = g_object_ref (G_OBJECT (device));
 	info->connection = connection ? g_object_ref (connection) : NULL;
+	info->cancellable = g_cancellable_new ();

This isn't required:

applet-device-broadband.c: In function ‘add_connection_item’:
applet-device-broadband.c:687:6: error: ‘BroadbandMenuItemInfo’ has no member named ‘cancellable’

only the cancellable in BroadbandDeviceInfo is required (added below).
Comment 4 Dan Williams 2013-02-26 23:07:44 UTC
Review of attachment 237336 [details] [review]:

Looks good.