aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPUserManager.m
diff options
context:
space:
mode:
authormltownsend <mltownsend@gmail.com>2009-12-03 00:58:28 +0000
committermltownsend <mltownsend@gmail.com>2009-12-03 00:58:28 +0000
commitcbafa5a85f87ce883f6be5cf75b19544560b750f (patch)
treebe2a6606e8a9e824e494ca1bd3659c4173d56453 /Source/SPUserManager.m
parent7c6172a54aae1c71bc4432afa5799293624c9d7f (diff)
downloadsequelpro-cbafa5a85f87ce883f6be5cf75b19544560b750f.tar.gz
sequelpro-cbafa5a85f87ce883f6be5cf75b19544560b750f.tar.bz2
sequelpro-cbafa5a85f87ce883f6be5cf75b19544560b750f.zip
Fix for issue with having multiple connections open and managing users.
Diffstat (limited to 'Source/SPUserManager.m')
-rw-r--r--Source/SPUserManager.m20
1 files changed, 16 insertions, 4 deletions
diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m
index 0a362395..4c75cc70 100644
--- a/Source/SPUserManager.m
+++ b/Source/SPUserManager.m
@@ -71,10 +71,10 @@
@"Replication_client_priv", @"Repl_client_priv",
nil];
- [[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(contextDidSave:)
- name:NSManagedObjectContextDidSaveNotification
- object:nil];
+ //[[NSNotificationCenter defaultCenter] addObserver:self
+// selector:@selector(contextDidSave:)
+// name:NSManagedObjectContextDidSaveNotification
+// object:nil];
}
@@ -316,6 +316,10 @@
managedObjectContext = [[NSManagedObjectContext alloc] init];
[managedObjectContext setPersistentStoreCoordinator: coordinator];
}
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(contextDidSave:)
+ name:NSManagedObjectContextDidSaveNotification
+ object:nil];
return managedObjectContext;
}
@@ -557,6 +561,9 @@
*/
- (void)contextDidSave:(NSNotification *)notification
{
+ NSManagedObjectContext *notificationContext = (NSManagedObjectContext *)[notification object];
+ if (notificationContext != self.managedObjectContext) return;
+
if (!isInitializing)
{
NSArray *updated = [[notification userInfo] valueForKey:NSUpdatedObjectsKey];
@@ -757,6 +764,11 @@
return NO;
}
+-(void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem
+{
+
+}
+
#pragma mark -
#pragma mark SplitView delegate methods