Skip to content
Permalink
Browse files
Fix an issue with autocompletion not suggesting column names (#2507)
Issue introduced in b7875e8
  • Loading branch information
dmoagx committed May 16, 2016
1 parent 05407e7 commit 943614e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
@@ -54,6 +54,7 @@

// Information
- (SPMySQLConnection *)connection;
- (SPDatabaseDocument *)delegate;

// Structure retrieval from the server
- (void)queryDbStructureInBackgroundWithUserInfo:(NSDictionary *)userInfo;
@@ -127,6 +127,11 @@ - (SPMySQLConnection *)connection
return [c autorelease];
}

- (SPDatabaseDocument *)delegate
{
return delegate;
}

#pragma mark -
#pragma mark Structure retrieval from the server

@@ -28,7 +28,7 @@
//
// More info at <https://github.com/sequelpro/sequelpro>

@class SPNavigatorOutlineView, SPSplitView;
@class SPNavigatorOutlineView, SPSplitView, SPDatabaseDocument;

@interface SPNavigatorController : NSWindowController
{
@@ -79,7 +79,7 @@
- (void)reloadAfterFiltering;
- (IBAction)syncButtonAction:(id)sender;

- (void)updateEntriesForConnection:(id)object;
- (void)updateEntriesForConnection:(SPDatabaseDocument *)doc;
- (NSString*)tableInfoLabelForIndex:(NSInteger)index ofType:(NSInteger)type;

- (void)updateNavigator:(NSNotification *)aNotification;
@@ -168,8 +168,7 @@ - (void)awakeFromNib
functionIcon = [[NSImage imageNamed:@"func-small"] retain];
fieldIcon = [[NSImage imageNamed:@"field-small-square"] retain];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNavigator:)
name:@"SPDBStructureWasUpdated" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNavigator:) name:@"SPDBStructureWasUpdated" object:nil];

}

@@ -408,16 +407,12 @@ - (void)selectInActiveDocumentItem:(id)item fromView:(id)outlineView

- (void)updateNavigator:(NSNotification *)aNotification
{
SPDatabaseDocument *object = [(SPDatabaseStructure *)[aNotification object] delegate];

id object = [aNotification object];

if([object isKindOfClass:[SPDatabaseDocument class]])
[self performSelectorOnMainThread:@selector(updateEntriesForConnection:) withObject:object waitUntilDone:NO];
else
[self performSelectorOnMainThread:@selector(updateEntriesForConnection:) withObject:nil waitUntilDone:NO];
[self performSelectorOnMainThread:@selector(updateEntriesForConnection:) withObject:object waitUntilDone:NO];
}

- (void)updateEntriesForConnection:(id)doc
- (void)updateEntriesForConnection:(SPDatabaseDocument *)doc
{

if(ignoreUpdate) {
@@ -431,8 +426,7 @@ - (void)updateEntriesForConnection:(id)doc
[cachedSortedKeys removeAllObjects];
}


if (doc && [doc isKindOfClass:[SPDatabaseDocument class]]) {
if (doc) {

SPMySQLConnection *theConnection = [doc getConnection];
if(!theConnection || ![theConnection isConnected]) return;
@@ -488,7 +482,7 @@ - (void)updateEntriesForConnection:(id)doc
if(isFiltered && [[self window] isVisible])
[self filterTree:self];

[[NSNotificationCenter defaultCenter] postNotificationName:@"SPNavigatorStructureWasUpdated" object:doc];
[[NSNotificationCenter defaultCenter] postNotificationName:@"SPNavigatorStructureWasUpdated" object:self];

}

0 comments on commit 943614e

Please sign in to comment.