oc: activate user context on initialization

This commit is contained in:
Jesús García Sáez
2015-07-14 16:47:38 +02:00
parent 7d2f96e96b
commit cfab18e1b8
4 changed files with 5 additions and 6 deletions

View File

@@ -108,13 +108,12 @@ static NSMutableDictionary *contextClassMapping;
NSArray *classes;
Class currentClass;
NSUInteger count, max;
MAPIStoreUserContext *userContext;
list = NULL;
userContext = [MAPIStoreUserContext userContextWithUsername: userName
andTDBIndexing: indexing];
[userContext activate];
// User context is activated on initialization
[MAPIStoreUserContext userContextWithUsername: userName
andTDBIndexing: indexing];
classes = GSObjCAllSubclassesOfClass (self);
max = [classes count];

View File

@@ -121,7 +121,6 @@
userContext = [MAPIStoreUserContext userContextWithUsername: userName
andTDBIndexing: NULL];
[userContext activate];
moduleName = [self MAPIModuleName];
parentFolder = [[userContext rootFolders] objectForKey: moduleName];
nameInContainer = nil;

View File

@@ -198,7 +198,6 @@ MakeDisplayFolderName (NSString *folderName)
userContext = [MAPIStoreUserContext userContextWithUsername: userName
andTDBIndexing: NULL];
[userContext activate];
accountFolder = [[userContext rootFolders] objectForKey: @"mail"];
folderName = [NSString stringWithFormat: @"folder%@",
[newFolderName asCSSIdentifier]];

View File

@@ -159,6 +159,8 @@ static NSMapTable *contextsTable = nil;
if ([userPassword length] == 0)
userPassword = username;
[authenticator setPassword: userPassword];
// Activate the profile on initialization
[self activate];
}
return self;