* or implied warranty.
*/
-#import <Cocoa/Cocoa.h>
-
@interface Identity : NSObject {
kim_identity kimIdentity;
int state;
}
+@end
+
@interface Identities : NSObject {
NSArray *identitiesArray;
+ NSMutableArray *favoriteIdentitiesArray;
+ NSMutableArray *ccacheIdentitiesArray;
NSConnection *threadConnection;
}
+- (int) update;
- (NSArray *) identities;
@end
return self;
}
-
-
-
@end
@implementation Identities
threadConnection = NULL;
favoriteIdentitiesArray = NULL;
- ccacheIdentitiesArray = NULL:
+ ccacheIdentitiesArray = NULL;
if (!err) {
self = [super init];
if (!err) {
kim_favorite_identities favoriteIdentities = NULL;
+ kim_count i;
kim_count count = 0;
- err = kim_favorite_identities_create (&favorite_identities);
+ err = kim_favorite_identities_create (&favoriteIdentities);
if (!err) {
err = kim_favorite_identities_get_number_of_identities (favoriteIdentities,
for (i = 0; !err && i < count; i++) {
kim_identity kimIdentity = NULL;
- Identity *identity = NULL:
+ Identity *identity = NULL;
err = kim_favorite_identities_get_identity_at_index (favoriteIdentities,
i, &kimIdentity);
if (!err) {
- Identity *identity = [[[Identity alloc] initWithIdentity: kimIdentity] autorelease];
+ identity = [[[Identity alloc] initWithIdentity: kimIdentity] autorelease];
if (!identity) { err = ENOMEM; }
}
- (NSArray *) identities
{
- return identities;
+ return identitiesArray;
}
// ---------------------------------------------------------------------------
err = KIM_NO_ERROR;
}
- kim_identity_free (&identity);
+ kim_identity_free (&kimIdentity);
kim_ccache_free (&ccache);
}
kim_ccache_iterator_free (&iterator);
if (err) {
- NSLog (@"Got error %s", kim_error_message (err));
+ NSLog (@"Got error %s", error_message (err));
}
return err;
kim_selection_hints_forget_identity
kim_selection_hints_free
+kim_favorite_identities_create
+kim_favorite_identities_copy
+kim_favorite_identities_get_number_of_identities
+kim_favorite_identities_get_identity_at_index
+kim_favorite_identities_add_identity
+kim_favorite_identities_remove_identity
+kim_favorite_identities_remove_all_identities
+kim_favorite_identities_free
+
kim_preferences_create
kim_preferences_copy
kim_preferences_set_options