[gnome-software] snap: Don't use deprecated API
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] snap: Don't use deprecated API
- Date: Thu, 16 Nov 2017 00:56:43 +0000 (UTC)
commit b4e6d7292360f7dc9c119e44a5dfa0ea1fda74b7
Author: Robert Ancell <robert ancell canonical com>
Date: Thu Nov 16 13:56:31 2017 +1300
snap: Don't use deprecated API
plugins/snap/gs-plugin-snap.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/plugins/snap/gs-plugin-snap.c b/plugins/snap/gs-plugin-snap.c
index adaabd9..ae8c586 100644
--- a/plugins/snap/gs-plugin-snap.c
+++ b/plugins/snap/gs-plugin-snap.c
@@ -957,12 +957,21 @@ gs_plugin_auth_login (GsPlugin *plugin, GsAuth *auth,
g_clear_object (&priv->auth_data);
if (priv->snapd_supports_polkit) {
g_autoptr(SnapdClient) client = NULL;
+#ifdef SNAPD_GLIB_VERSION_1_26
+ g_autoptr(SnapdUserInformation) user_information = NULL;
+#endif
client = get_client (plugin, error);
if (client == NULL)
return FALSE;
+#ifdef SNAPD_GLIB_VERSION_1_26
+ user_information = snapd_client_login2_sync (client, gs_auth_get_username (auth),
gs_auth_get_password (auth), gs_auth_get_pin (auth), NULL, error);
+ if (user_information != NULL)
+ priv->auth_data = g_object_ref (snapd_user_information_get_auth_data
(user_information));
+#else
priv->auth_data = snapd_client_login_sync (client, gs_auth_get_username (auth),
gs_auth_get_password (auth), gs_auth_get_pin (auth), NULL, error);
+#endif
}
else
priv->auth_data = snapd_login_sync (gs_auth_get_username (auth), gs_auth_get_password (auth),
gs_auth_get_pin (auth), NULL, error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]