aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseDocument.m
diff options
context:
space:
mode:
authorsqlprodev <sqlprodev@northofthree.com>2011-04-14 19:57:45 +0000
committersqlprodev <sqlprodev@northofthree.com>2011-04-14 19:57:45 +0000
commit8c2e3126426c0c4c9e5bc2392879a850d3373641 (patch)
tree8a6963b5efd578e8586bd808d5f204a81a85c6dc /Source/SPDatabaseDocument.m
parentad7328e56541556d23f527303deddaefd4253ef2 (diff)
downloadsequelpro-8c2e3126426c0c4c9e5bc2392879a850d3373641.tar.gz
sequelpro-8c2e3126426c0c4c9e5bc2392879a850d3373641.tar.bz2
sequelpro-8c2e3126426c0c4c9e5bc2392879a850d3373641.zip
SP_REFACTOR: Workaround for naming conflict with postNotificationOnMainThread: which also exists in TCMPortMapper.framework; NSUserDefaults access now permitted in SP_REFACTOR blocks for a few prefs keys
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r--Source/SPDatabaseDocument.m25
1 files changed, 23 insertions, 2 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index e81a7c05..7bb28a97 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -74,6 +74,7 @@
#ifdef SP_REFACTOR /* headers */
#import "SPAlertSheets.h"
+#import "NSNotificationAdditions.h"
#endif
@interface SPDatabaseDocument (PrivateAPI)
@@ -931,7 +932,11 @@
NSString *dbName = nil;
// Notify listeners that a query has started
+#ifndef SP_REFACTOR
[[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:@"SMySQLQueryWillBePerformed" object:self];
+#else
+ [[NSNotificationCenter defaultCenter] sequelProPostNotificationOnMainThreadWithName:@"SMySQLQueryWillBePerformed" object:self];
+#endif
MCPResult *theResult = [mySQLConnection queryString:@"SELECT DATABASE()"];
if (![mySQLConnection queryErrored]) {
@@ -960,7 +965,11 @@
}
//query finished
+#ifndef SP_REFACTOR
[[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:@"SMySQLQueryHasBeenPerformed" object:self];
+#else
+ [[NSNotificationCenter defaultCenter] sequelProPostNotificationOnMainThreadWithName:@"SMySQLQueryHasBeenPerformed" object:self];
+#endif
}
#ifndef SP_REFACTOR /* navigatorSchemaPathExistsForDatabase: */
@@ -3961,6 +3970,7 @@
// If the task interface is visible, and this tab is frontmost, re-center the task child window
if (_isWorkingLevel && [parentWindowController selectedTableDocument] == self) [self centerTaskWindow];
}
+#endif
/**
* Set the parent window
@@ -3969,7 +3979,9 @@
{
// If the window is being set for the first time - connection controller is visible - update focus
if (!parentWindow && !mySQLConnection) {
+#ifndef SP_REFACTOR
[aWindow makeFirstResponder:[connectionController valueForKey:@"favoritesTable"]];
+#endif
[connectionController performSelector:@selector(updateFavoriteSelection:) withObject:self afterDelay:0.0];
}
@@ -3986,6 +3998,7 @@
return parentWindow;
}
+#ifndef SP_REFACTOR
#pragma mark -
#pragma mark NSDocument compatibility
@@ -5210,7 +5223,11 @@
- (void)registerActivity:(NSDictionary*)commandDict
{
[runningActivitiesArray addObject:commandDict];
- [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:SPActivitiesUpdateNotification object:nil];
+#ifndef SP_REFACTOR
+ [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:SPActivitiesUpdateNotification object:self];
+#else
+ [[NSNotificationCenter defaultCenter] sequelProPostNotificationOnMainThreadWithName:SPActivitiesUpdateNotification object:self];
+#endif
if([runningActivitiesArray count] || [[[NSApp delegate] runningActivities] count])
[self performSelector:@selector(setActivityPaneHidden:) withObject:[NSNumber numberWithInteger:0] afterDelay:1.0];
@@ -5242,7 +5259,11 @@
[self setActivityPaneHidden:[NSNumber numberWithInteger:1]];
}
- [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:SPActivitiesUpdateNotification object:nil];
+#ifndef SP_REFACTOR
+ [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:SPActivitiesUpdateNotification object:self];
+#else
+ [[NSNotificationCenter defaultCenter] sequelProPostNotificationOnMainThreadWithName:SPActivitiesUpdateNotification object:self];
+#endif
}