Change Details
| bridges/facebook/src/facebook.vala |
| 90 | 90 | |
| 91 | 91 | var pwdData = new HashTable<string, string> (str_hash, str_equal); |
| 92 | 92 | pwdData.insert ("session", session); |
| 93 | | Tracker.passwordProvider.save (username, SERVICE_NAME, secret, "Authentication token for Facebook", pwdData); |
| 93 | Tracker.PasswordProvider.instance ().save (username, SERVICE_NAME, secret, "Authentication token for Facebook", pwdData); |
| 94 | 94 | |
| 95 | 95 | c = rest.new_call (); |
| 96 | 96 | c.add_params ("method", "users.getInfo", |
| ... | ... | |
| 115 | 115 | |
| 116 | 116 | public void Authenticate () |
| 117 | 117 | { |
| 118 | | var pwdData = Tracker.passwordProvider.search (null, SERVICE_NAME); |
| 118 | var pwdData = Tracker.PasswordProvider.instance ().search (null, SERVICE_NAME); |
| 119 | 119 | |
| 120 | 120 | if (pwdData != null) { |
| 121 | 121 | username = pwdData.lookup ("username"); |
| bridges/flickr/src/flickr.vala |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | try { |
| 96 | | Tracker.passwordProvider.save (username, SERVICE_NAME, token, "Authentication token for Flickr"); |
| 96 | Tracker.PasswordProvider.instance ().save (username, SERVICE_NAME, token, "Authentication token for Flickr"); |
| 97 | 97 | } catch (Error e) { |
| 98 | 98 | critical ("Cannot store token : %s", e.message); |
| 99 | 99 | } |
| ... | ... | |
| 108 | 108 | |
| 109 | 109 | HashTable<string, string> pwdData = null; |
| 110 | 110 | try { |
| 111 | | pwdData = Tracker.passwordProvider.search (null, SERVICE_NAME); |
| 111 | pwdData = Tracker.PasswordProvider.instance ().search (null, SERVICE_NAME); |
| 112 | 112 | } catch (Error e) { |
| 113 | 113 | critical ("Cannot retrieve stored token : %s", e.message); |
| 114 | 114 | } |
| bridges/gdata/src/gdata-bridge-picasaweb.vala |
| 36 | 36 | { |
| 37 | 37 | HashTable<string, string> pwdData = null; |
| 38 | 38 | try { |
| 39 | | pwdData = Tracker.passwordProvider.search (null, SERVICE_NAME); |
| 39 | pwdData = Tracker.PasswordProvider.instance ().search (null, SERVICE_NAME); |
| 40 | 40 | } catch (Error e) { |
| 41 | 41 | critical ("Couldn't retrieve stored passowrd : %s", e.message); |
| 42 | 42 | } |
| ... | ... | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | try { |
| 82 | | Tracker.passwordProvider.save (data.lookup ("user"), SERVICE_NAME, data.lookup ("password"), _("Authentification data for Google services (PicasaWeb)")); |
| 82 | Tracker.PasswordProvider.instance ().save (data.lookup ("user"), SERVICE_NAME, data.lookup ("password"), _("Authentification data for Google services (PicasaWeb)")); |
| 83 | 83 | } catch (Error e) { |
| 84 | 84 | critical ("Error while storing password : %s", e.message); |
| 85 | 85 | } |
| libtrackerbridge/src/gnome-password-provider.vala |
| 2 | 2 | using Serializer; |
| 3 | 3 | |
| 4 | 4 | namespace Tracker { |
| 5 | | class GnomePasswordProvider : Tracker.PasswordProvider { |
| 5 | class GnomePasswordProvider : Tracker.PasswordProviderIface, Object { |
| 6 | 6 | |
| 7 | 7 | private const GnomeKeyring.PasswordSchema passwordSchema = { |
| 8 | 8 | GnomeKeyring.ItemType.GENERIC_SECRET, |
| libtrackerbridge/src/tracker-bridge.vala |
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | | public interface PasswordProvider { |
| 29 | public interface PasswordProviderIface : Object { |
| 30 | 30 | // Saves a password token in the database |
| 31 | 31 | // username and service can be used to find back the token |
| 32 | 32 | // description : an optional description of the credentials |
| ... | ... | |
| 39 | 39 | public abstract HashTable<string, string>? search (string? username, string? service) throws Error; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | | public static const PasswordProvider passwordProvider = new GnomePasswordProvider (); |
| 42 | public class PasswordProvider : Object { |
| 43 | private static PasswordProviderIface _instance = new GnomePasswordProvider (); |
| 44 | |
| 45 | public static PasswordProviderIface instance () { |
| 46 | return _instance; |
| 47 | } |
| 48 | } |
| 43 | 49 | |
| 44 | 50 | public static string getTagUri (string tagname) |
| 45 | 51 | { |
Download the corresponding diff file