aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPUserManager.m
diff options
context:
space:
mode:
authorAbhi Beckert <abhi@Twist-of-Lemon-2.local>2015-05-16 08:06:06 +1000
committerAbhi Beckert <abhi@Twist-of-Lemon-2.local>2015-05-16 08:06:06 +1000
commit57a6f6c73bdaa202164645370d37fcbe5d14a092 (patch)
treedd30aa6156064f1d4c0e10ea87059625470fc2f9 /Source/SPUserManager.m
parentb5e972f4504043dfb9c358e272e93fb59ae2127f (diff)
parent0f0c43eb74408b6a65a42e2c6fd46f4142ef8e3f (diff)
downloadsequelpro-57a6f6c73bdaa202164645370d37fcbe5d14a092.tar.gz
sequelpro-57a6f6c73bdaa202164645370d37fcbe5d14a092.tar.bz2
sequelpro-57a6f6c73bdaa202164645370d37fcbe5d14a092.zip
Merge remote-tracking branch 'sequelpro/master'
Diffstat (limited to 'Source/SPUserManager.m')
-rw-r--r--Source/SPUserManager.m50
1 files changed, 26 insertions, 24 deletions
diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m
index 3ac9e5de..e3f611c3 100644
--- a/Source/SPUserManager.m
+++ b/Source/SPUserManager.m
@@ -135,7 +135,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn";
treeSortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"displayName" ascending:YES];
- [self setTreeSortDescriptors:[NSArray arrayWithObject:treeSortDescriptor]];
+ [self setTreeSortDescriptors:@[treeSortDescriptor]];
[super windowDidLoad];
}
@@ -183,7 +183,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn";
[privKey replaceOccurrencesOfString:@" " withString:@"_" options:NSLiteralSearch range:NSMakeRange(0, [privKey length])];
[privKey appendString:@"_priv"];
- [[self privsSupportedByServer] setValue:[NSNumber numberWithBool:YES] forKey:privKey];
+ [[self privsSupportedByServer] setValue:@YES forKey:privKey];
}
}
// If that fails, base privilege support on the mysql.users columns
@@ -200,7 +200,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn";
if ([privColumnToGrantMap objectForKey:privKey]) privKey = [privColumnToGrantMap objectForKey:privKey];
- [[self privsSupportedByServer] setValue:[NSNumber numberWithBool:YES] forKey:[privKey lowercaseString]];
+ [[self privsSupportedByServer] setValue:@YES forKey:[privKey lowercaseString]];
}
}
@@ -281,7 +281,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn";
[[self managedObjectContext] save:&error];
if (error != nil) {
- [[NSApplication sharedApplication] presentError:error];
+ [NSApp presentError:error];
}
[parentResults release];
@@ -443,7 +443,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn";
persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel: [self managedObjectModel]];
if (![persistentStoreCoordinator addPersistentStoreWithType:NSInMemoryStoreType configuration:nil URL:nil options:nil error:&error]) {
- [[NSApplication sharedApplication] presentError:error];
+ [NSApp presentError:error];
}
return persistentStoreCoordinator;
@@ -555,12 +555,12 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn";
didEndSelector:NULL
contextInfo:nil];
- [errorsString release];
+ SPClear(errorsString);
return;
}
- [errorsString release];
+ SPClear(errorsString);
// Otherwise, close the sheet
[NSApp endSheet:[self window] returnCode:0];
@@ -580,7 +580,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn";
// Perform the change in a try/catch check to avoid exceptions for unhandled privs
NS_DURING
- [selectedUser setValue:[NSNumber numberWithBool:YES] forKey:key];
+ [selectedUser setValue:@YES forKey:key];
NS_HANDLER
NS_ENDHANDLER
}
@@ -600,7 +600,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn";
// Perform the change in a try/catch check to avoid exceptions for unhandled privs
NS_DURING
- [selectedUser setValue:[NSNumber numberWithBool:NO] forKey:key];
+ [selectedUser setValue:@NO forKey:key];
NS_HANDLER
NS_ENDHANDLER
}
@@ -848,7 +848,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn";
- (void)_clearData
{
[managedObjectContext reset];
- [managedObjectContext release], managedObjectContext = nil;
+ SPClear(managedObjectContext);
}
/**
@@ -1261,7 +1261,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn";
NSArray *array = [moc executeFetchRequest:request error:&error];
if (error != nil) {
- [[NSApplication sharedApplication] presentError:error];
+ [NSApp presentError:error];
}
return array;
@@ -1297,7 +1297,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn";
NSArray *array = [moc executeFetchRequest:request error:&error];
if (error != nil) {
- [[NSApplication sharedApplication] presentError:error];
+ [NSApp presentError:error];
}
return array;
@@ -1458,18 +1458,20 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn";
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
-
- [managedObjectContext release];
- [persistentStoreCoordinator release];
- [managedObjectModel release];
- [privColumnToGrantMap release];
- [connection release];
- [privsSupportedByServer release];
- [schemas release];
- [availablePrivs release];
- [grantedSchemaPrivs release];
- [treeSortDescriptor release];
- [serverSupport release];
+
+
+ SPClear(managedObjectContext);
+ SPClear(persistentStoreCoordinator);
+ SPClear(managedObjectModel);
+ SPClear(privColumnToGrantMap);
+ SPClear(connection);
+ SPClear(privsSupportedByServer);
+ SPClear(schemas);
+ SPClear(availablePrivs);
+ SPClear(grantedSchemaPrivs);
+ SPClear(treeSortDescriptor);
+ SPClear(treeSortDescriptors);
+ SPClear(serverSupport);
[super dealloc];
}