~alecu/unity-lens-music/fix-1168674

« back to all changes in this revision

Viewing changes to src/ubuntuone-webservices.vala

  • Committer: Alejandro J. Cura
  • Date: 2013-04-18 15:30:44 UTC
  • mfrom: (132.6.2 trunk)
  • Revision ID: alecu@canonical.com-20130418153044-o52xhx68zpz6hz1z
merged fix for bug #1168674 from trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
[DBus (name = "com.ubuntuone.CredentialsManagement")]
23
23
interface CredentialsManagement : GLib.Object {
24
24
    public signal void credentials_found (HashTable <string, string> info);
25
 
    public signal void credentials_error ();
 
25
    public signal void credentials_not_found ();
 
26
    public signal void credentials_error (HashTable <string, string> error_dict);
26
27
 
27
28
    [DBus (name = "find_credentials")]
28
29
    public abstract void find_credentials () throws IOError;
167
168
            }
168
169
        }
169
170
 
170
 
        internal virtual async void fetch_credentials () throws PurchaseError
 
171
        public virtual async void fetch_credentials () throws PurchaseError
171
172
        {
172
173
            PurchaseError error = null;
173
174
 
176
177
                debug ("got credentials");
177
178
                fetch_credentials.callback ();
178
179
            });
179
 
            ulong error_handler = credentials_management.credentials_error.connect (() => {
 
180
            ulong not_found_handler = credentials_management.credentials_not_found.connect (() => {
 
181
                                error = new PurchaseError.MISSING_CREDENTIALS_ERROR ("No Ubuntu One tokens.");
 
182
                                fetch_credentials.callback ();
 
183
                        });
 
184
            ulong error_handler = credentials_management.credentials_error.connect ((error_dict) => {
180
185
                error = new PurchaseError.MISSING_CREDENTIALS_ERROR ("Can't get Ubuntu One tokens.");
181
186
                fetch_credentials.callback ();
182
187
            });
189
194
            }
190
195
 
191
196
            credentials_management.disconnect (found_handler);
 
197
            credentials_management.disconnect (not_found_handler);
192
198
            credentials_management.disconnect (error_handler);
193
199
 
194
200
            if (error != null) {