[gnome-software/gnome-3-26] snap: Don't use deprecated API



commit cd6d14460f4be9ab37c0482975bddced2d5adbd7
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 file changed, 9 insertions(+)
---
diff --git a/plugins/snap/gs-plugin-snap.c b/plugins/snap/gs-plugin-snap.c
index 0367b014..f4676191 100644
--- a/plugins/snap/gs-plugin-snap.c
+++ b/plugins/snap/gs-plugin-snap.c
@@ -950,12 +950,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]