@@ -168,8 +168,7 @@ - (void)awakeFromNib
168
168
functionIcon = [[NSImage imageNamed: @" func-small" ] retain ];
169
169
fieldIcon = [[NSImage imageNamed: @" field-small-square" ] retain ];
170
170
171
- [[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (updateNavigator: )
172
- name: @" SPDBStructureWasUpdated" object: nil ];
171
+ [[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (updateNavigator: ) name: @" SPDBStructureWasUpdated" object: nil ];
173
172
174
173
}
175
174
@@ -408,16 +407,12 @@ - (void)selectInActiveDocumentItem:(id)item fromView:(id)outlineView
408
407
409
408
- (void )updateNavigator : (NSNotification *)aNotification
410
409
{
410
+ SPDatabaseDocument *object = [(SPDatabaseStructure *)[aNotification object ] delegate ];
411
411
412
- id object = [aNotification object ];
413
-
414
- if ([object isKindOfClass: [SPDatabaseDocument class ]])
415
- [self performSelectorOnMainThread: @selector (updateEntriesForConnection: ) withObject: object waitUntilDone: NO ];
416
- else
417
- [self performSelectorOnMainThread: @selector (updateEntriesForConnection: ) withObject: nil waitUntilDone: NO ];
412
+ [self performSelectorOnMainThread: @selector (updateEntriesForConnection: ) withObject: object waitUntilDone: NO ];
418
413
}
419
414
420
- - (void )updateEntriesForConnection : (id )doc
415
+ - (void )updateEntriesForConnection : (SPDatabaseDocument * )doc
421
416
{
422
417
423
418
if (ignoreUpdate) {
@@ -431,8 +426,7 @@ - (void)updateEntriesForConnection:(id)doc
431
426
[cachedSortedKeys removeAllObjects ];
432
427
}
433
428
434
-
435
- if (doc && [doc isKindOfClass: [SPDatabaseDocument class ]]) {
429
+ if (doc) {
436
430
437
431
SPMySQLConnection *theConnection = [doc getConnection ];
438
432
if (!theConnection || ![theConnection isConnected ]) return ;
@@ -488,7 +482,7 @@ - (void)updateEntriesForConnection:(id)doc
488
482
if (isFiltered && [[self window ] isVisible ])
489
483
[self filterTree: self ];
490
484
491
- [[NSNotificationCenter defaultCenter ] postNotificationName: @" SPNavigatorStructureWasUpdated" object: doc ];
485
+ [[NSNotificationCenter defaultCenter ] postNotificationName: @" SPNavigatorStructureWasUpdated" object: self ];
492
486
493
487
}
494
488
0 commit comments