aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <dmoagx@users.noreply.github.com>2017-12-29 22:37:50 +0100
committerMax <dmoagx@users.noreply.github.com>2018-01-20 02:42:36 +0100
commit2602f2abd70c2e83a50099fca0141c241552f68f (patch)
tree9b3aee49a0417effbd4d3a95147c399838ae7221
parent0b096429fee59f72d0191a05d56d3b06229afd4e (diff)
downloadsequelpro-2602f2abd70c2e83a50099fca0141c241552f68f.tar.gz
sequelpro-2602f2abd70c2e83a50099fca0141c241552f68f.tar.bz2
sequelpro-2602f2abd70c2e83a50099fca0141c241552f68f.zip
merge SPQueryController (part of #2789)
-rw-r--r--Source/SPContentFilterManager.m1
-rw-r--r--Source/SPCustomQuery.m1
-rw-r--r--Source/SPDatabaseDocument.m1
-rw-r--r--Source/SPNarrowDownCompletion.m1
-rw-r--r--Source/SPQueryConsoleDataSource.h35
-rw-r--r--Source/SPQueryConsoleDataSource.m111
-rw-r--r--Source/SPQueryController.h32
-rw-r--r--Source/SPQueryController.m564
-rw-r--r--Source/SPQueryControllerInitializer.h37
-rw-r--r--Source/SPQueryControllerInitializer.m145
-rw-r--r--Source/SPQueryDocumentsController.h61
-rw-r--r--Source/SPQueryDocumentsController.m414
-rw-r--r--Source/SPQueryFavoriteManager.m1
-rw-r--r--Source/SPTableContent.m1
-rw-r--r--Source/SPTextView.m1
-rw-r--r--sequel-pro.xcodeproj/project.pbxproj18
16 files changed, 595 insertions, 829 deletions
diff --git a/Source/SPContentFilterManager.m b/Source/SPContentFilterManager.m
index 512e19d8..bf29d15a 100644
--- a/Source/SPContentFilterManager.m
+++ b/Source/SPContentFilterManager.m
@@ -32,7 +32,6 @@
#import "ImageAndTextCell.h"
#import "RegexKitLite.h"
#import "SPQueryController.h"
-#import "SPQueryDocumentsController.h"
#import "SPDatabaseDocument.h"
#import "SPTableContent.h"
#import "SPConnectionController.h"
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index a1e14a1f..0f880e8c 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -46,7 +46,6 @@
#import "SPQueryFavoriteManager.h"
#endif
#import "SPQueryController.h"
-#import "SPQueryDocumentsController.h"
#import "SPEncodingPopupAccessory.h"
#import "SPDataStorage.h"
#import "SPAlertSheets.h"
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 1961cbe7..dd781992 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -43,7 +43,6 @@
#import "SPExportController.h"
#import "SPSplitView.h"
#import "SPQueryController.h"
-#import "SPQueryDocumentsController.h"
#import "SPWindowController.h"
#import "SPNavigatorController.h"
#import "SPSQLParser.h"
diff --git a/Source/SPNarrowDownCompletion.m b/Source/SPNarrowDownCompletion.m
index c2158299..ad355c26 100644
--- a/Source/SPNarrowDownCompletion.m
+++ b/Source/SPNarrowDownCompletion.m
@@ -38,7 +38,6 @@
#import "SPQueryController.h"
#import "RegexKitLite.h"
#import "SPTextView.h"
-#import "SPQueryDocumentsController.h"
#import "SPDatabaseStructure.h"
#pragma mark -
diff --git a/Source/SPQueryConsoleDataSource.h b/Source/SPQueryConsoleDataSource.h
deleted file mode 100644
index ac0ce88b..00000000
--- a/Source/SPQueryConsoleDataSource.h
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// SPQueryConsoleDataSource.h
-// sequel-pro
-//
-// Created by Stuart Connolly (stuconnolly.com) on August 30, 2011.
-// Copyright (c) 2011 Stuart Connolly. All rights reserved.
-//
-// Permission is hereby granted, free of charge, to any person
-// obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without
-// restriction, including without limitation the rights to use,
-// copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following
-// conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-// More info at <https://github.com/sequelpro/sequelpro>
-
-#import "SPQueryController.h"
-
-@interface SPQueryController (SPQueryConsoleDataSource)
-
-@end
diff --git a/Source/SPQueryConsoleDataSource.m b/Source/SPQueryConsoleDataSource.m
deleted file mode 100644
index eb669051..00000000
--- a/Source/SPQueryConsoleDataSource.m
+++ /dev/null
@@ -1,111 +0,0 @@
-//
-// SPQueryConsoleDataSource.m
-// sequel-pro
-//
-// Created by Stuart Connolly (stuconnolly.com) on August 30, 2011.
-// Copyright (c) 2011 Stuart Connolly. All rights reserved.
-//
-// Permission is hereby granted, free of charge, to any person
-// obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without
-// restriction, including without limitation the rights to use,
-// copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following
-// conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-// More info at <https://github.com/sequelpro/sequelpro>
-
-#import "SPQueryConsoleDataSource.h"
-#import "SPConsoleMessage.h"
-
-static NSUInteger SPMessageTruncateCharacterLength = 256;
-
-@implementation SPQueryController (SPQueryConsoleDataSource)
-
-/**
- * Table view delegate method. Returns the number of rows in the table veiw.
- */
-- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView
-{
-#ifndef SP_CODA
- return [messagesVisibleSet count];
-#else
- return 0;
-#endif
-}
-
-/**
- * Table view delegate method. Returns the specific object for the requested column and row.
- */
-- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
-{
-#ifndef SP_CODA
- NSString *returnValue = nil;
-
- NSString *identifier = [tableColumn identifier];
-
- if (!identifier) return returnValue;
-
- id object = [[messagesVisibleSet objectAtIndex:row] valueForKey:identifier];
-
- if ([[tableColumn identifier] isEqualToString:SPTableViewDateColumnID]) {
-
- returnValue = [dateFormatter stringFromDate:(NSDate *)object];
- }
- else {
- if ([(NSString *)object length] > SPMessageTruncateCharacterLength) {
- object = [NSString stringWithFormat:@"%@...", [object substringToIndex:SPMessageTruncateCharacterLength]];
- }
-
- returnValue = object;
- }
-
- if (!returnValue) return returnValue;
-
- NSMutableDictionary *stringAtributes = nil;
-
- if (consoleFont) {
- stringAtributes = [NSMutableDictionary dictionaryWithObject:consoleFont forKey:NSFontAttributeName];
- }
-
- // If this is an error message give it a red colour
- if ([(SPConsoleMessage *)[messagesVisibleSet objectAtIndex:row] isError]) {
- if (stringAtributes) {
- [stringAtributes setObject:[NSColor redColor] forKey:NSForegroundColorAttributeName];
- }
- else {
- stringAtributes = [NSMutableDictionary dictionaryWithObject:[NSColor redColor] forKey:NSForegroundColorAttributeName];
- }
- }
-
- return [[[NSAttributedString alloc] initWithString:returnValue attributes:stringAtributes] autorelease];
-#else
- return nil;
-#endif
-}
-
-- (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard
-{
- NSString *string = [self sqlStringForRowIndexes:rowIndexes];
- if([string length]) {
- [pboard declareTypes:@[NSStringPboardType] owner:self];
- return [pboard setString:string forType:NSStringPboardType];
- }
-
- return NO;
-}
-
-@end
diff --git a/Source/SPQueryController.h b/Source/SPQueryController.h
index 12ff6d7b..ea292dd9 100644
--- a/Source/SPQueryController.h
+++ b/Source/SPQueryController.h
@@ -120,4 +120,36 @@ extern NSString *SPTableViewDatabaseColumnID;
*/
- (NSString *)sqlStringForRowIndexes:(NSIndexSet *)indexes;
+#pragma mark - SPQueryControllerInitializer
+
+- (NSError *)loadCompletionLists;
+
+#pragma mark - SPQueryDocumentsController
+
+- (NSURL *)registerDocumentWithFileURL:(NSURL *)fileURL andContextInfo:(NSMutableDictionary *)contextInfo;
+- (void)removeRegisteredDocumentWithFileURL:(NSURL *)fileURL;
+
+- (void)addFavorite:(NSDictionary *)favorite forFileURL:(NSURL *)fileURL;
+- (void)replaceFavoritesByArray:(NSArray *)favoritesArray forFileURL:(NSURL *)fileURL;
+- (void)removeFavoriteAtIndex:(NSUInteger)index forFileURL:(NSURL *)fileURL;
+- (void)insertFavorite:(NSDictionary *)favorite atIndex:(NSUInteger)index forFileURL:(NSURL *)fileURL;
+
+- (void)addHistory:(NSString *)history forFileURL:(NSURL *)fileURL;
+- (void)replaceHistoryByArray:(NSArray *)historyArray forFileURL:(NSURL *)fileURL;
+
+- (void)replaceContentFilterByArray:(NSArray *)contentFilterArray ofType:(NSString *)filterType forFileURL:(NSURL *)fileURL;
+
+- (NSMutableArray *)favoritesForFileURL:(NSURL *)fileURL;
+- (NSMutableArray *)historyForFileURL:(NSURL *)fileURL;
+- (NSArray *)historyMenuItemsForFileURL:(NSURL *)fileURL;
+- (NSUInteger)numberOfHistoryItemsForFileURL:(NSURL *)fileURL;
+- (NSMutableDictionary *)contentFilterForFileURL:(NSURL *)fileURL;
+
+- (NSArray *)queryFavoritesForFileURL:(NSURL *)fileURL andTabTrigger:(NSString *)tabTrigger includeGlobals:(BOOL)includeGlobals;
+
+// Completion list controller
+- (NSArray*)functionList;
+- (NSArray*)keywordList;
+- (NSString*)argumentSnippetForFunction:(NSString*)func;
+
@end
diff --git a/Source/SPQueryController.m b/Source/SPQueryController.m
index 41d71154..87709949 100644
--- a/Source/SPQueryController.m
+++ b/Source/SPQueryController.m
@@ -31,7 +31,7 @@
#import "SPQueryController.h"
#import "SPConsoleMessage.h"
#import "SPCustomQuery.h"
-#import "SPQueryControllerInitializer.h"
+#import "SPAppController.h"
#import "pthread.h"
@@ -40,8 +40,16 @@ NSString *SPQueryConsoleWindowAutoSaveName = @"QueryConsole";
NSString *SPTableViewDateColumnID = @"messageDate";
NSString *SPTableViewConnectionColumnID = @"messageConnection";
NSString *SPTableViewDatabaseColumnID = @"messageDatabase";
+
+static NSString *SPCompletionTokensFilename = @"CompletionTokens.plist";
+
+static NSString *SPCompletionTokensKeywordsKey = @"core_keywords";
+static NSString *SPCompletionTokensFunctionsKey = @"core_builtin_functions";
+static NSString *SPCompletionTokensSnippetsKey = @"function_argument_snippets";
#endif
+static NSUInteger SPMessageTruncateCharacterLength = 256;
+
@interface SPQueryController ()
- (void)_updateFilterState;
@@ -640,6 +648,560 @@ static SPQueryController *sharedQueryController = nil;
#endif
}
+#pragma mark - SPQueryControllerInitializer
+
+/**
+ * Set the window's auto save name and initialise display.
+ */
+- (void)awakeFromNib
+{
+#ifndef SP_CODA /* init ivars */
+ prefs = [NSUserDefaults standardUserDefaults];
+
+ [self setWindowFrameAutosaveName:SPQueryConsoleWindowAutoSaveName];
+
+ // Show/hide table columns
+ [[consoleTableView tableColumnWithIdentifier:SPTableViewDateColumnID] setHidden:![prefs boolForKey:SPConsoleShowTimestamps]];
+ [[consoleTableView tableColumnWithIdentifier:SPTableViewConnectionColumnID] setHidden:![prefs boolForKey:SPConsoleShowConnections]];
+ [[consoleTableView tableColumnWithIdentifier:SPTableViewDatabaseColumnID] setHidden:![prefs boolForKey:SPConsoleShowDatabases]];
+
+ showSelectStatementsAreDisabled = ![prefs boolForKey:SPConsoleShowSelectsAndShows];
+ showHelpStatementsAreDisabled = ![prefs boolForKey:SPConsoleShowHelps];
+
+ [self _updateFilterState];
+
+ [loggingDisabledTextField setStringValue:([prefs boolForKey:SPConsoleEnableLogging]) ? @"" : NSLocalizedString(@"Query logging is currently disabled", @"query logging disabled label")];
+
+ // Setup data formatter
+ dateFormatter = [[NSDateFormatter alloc] init];
+
+ [dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
+
+ [dateFormatter setDateStyle:NSDateFormatterNoStyle];
+ [dateFormatter setTimeStyle:NSDateFormatterMediumStyle];
+
+ // Set the process table view's vertical gridlines if required
+ [consoleTableView setGridStyleMask:([prefs boolForKey:SPDisplayTableViewVerticalGridlines]) ? NSTableViewSolidVerticalGridLineMask : NSTableViewGridNone];
+
+ // Set the strutcture and index view's font
+ BOOL useMonospacedFont = [prefs boolForKey:SPUseMonospacedFonts];
+ CGFloat monospacedFontSize = [prefs floatForKey:SPMonospacedFontSize] > 0 ? [prefs floatForKey:SPMonospacedFontSize] : [NSFont smallSystemFontSize];
+
+ for (NSTableColumn *column in [consoleTableView tableColumns])
+ {
+ [[column dataCell] setFont:(useMonospacedFont) ? [NSFont fontWithName:SPDefaultMonospacedFontName size:monospacedFontSize] : [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
+ }
+
+ //allow drag-out copying of selected rows
+ [consoleTableView setDraggingSourceOperationMask:NSDragOperationCopy forLocal:NO];
+#endif
+}
+
+/**
+ * Loads the query controller's completion tokens data.
+ */
+- (NSError *)loadCompletionLists
+{
+ NSError *readError = nil;
+ NSString *convError = nil;
+ NSString *errorDescription = nil;
+
+ NSPropertyListFormat format;
+ NSData *completionTokensData = [NSData dataWithContentsOfFile:
+ [NSBundle pathForResource:SPCompletionTokensFilename
+ ofType:nil
+ inDirectory:[[NSBundle mainBundle] bundlePath]]
+ options:NSMappedRead error:&readError];
+
+ NSDictionary *completionPlist = [NSDictionary dictionaryWithDictionary:
+ [NSPropertyListSerialization propertyListFromData:completionTokensData
+ mutabilityOption:NSPropertyListMutableContainersAndLeaves
+ format:&format
+ errorDescription:&convError]];
+
+ if (completionPlist == nil || readError != nil || convError != nil) {
+ errorDescription = [NSString stringWithFormat:@"Error reading '%@': %@, %@", SPCompletionTokensFilename, [readError localizedDescription], convError];
+ }
+ else {
+ if ([completionPlist objectForKey:SPCompletionTokensKeywordsKey]) {
+ completionKeywordList = [[NSArray arrayWithArray:[completionPlist objectForKey:SPCompletionTokensKeywordsKey]] retain];
+ }
+ else {
+ errorDescription = [NSString stringWithFormat:@"No '%@' array found.", SPCompletionTokensKeywordsKey];
+ }
+
+ if ([completionPlist objectForKey:SPCompletionTokensFunctionsKey]) {
+ completionFunctionList = [[NSArray arrayWithArray:[completionPlist objectForKey:SPCompletionTokensFunctionsKey]] retain];
+ }
+ else {
+ errorDescription = [NSString stringWithFormat:@"No '%@' array found.", SPCompletionTokensFunctionsKey];
+ }
+
+ if ([completionPlist objectForKey:SPCompletionTokensSnippetsKey]) {
+ functionArgumentSnippets = [[NSDictionary dictionaryWithDictionary:[completionPlist objectForKey:SPCompletionTokensSnippetsKey]] retain];
+ }
+ else {
+ errorDescription = [NSString stringWithFormat:@"No '%@' dictionary found.", SPCompletionTokensSnippetsKey];
+ }
+ }
+
+ return errorDescription ? [NSError errorWithDomain:NSCocoaErrorDomain code:1 userInfo:@{NSLocalizedDescriptionKey : errorDescription}] : nil;
+}
+
+#pragma mark - SPQueryConsoleDataSource
+
+/**
+ * Table view delegate method. Returns the number of rows in the table veiw.
+ */
+- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView
+{
+#ifndef SP_CODA
+ return [messagesVisibleSet count];
+#else
+ return 0;
+#endif
+}
+
+/**
+ * Table view delegate method. Returns the specific object for the requested column and row.
+ */
+- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
+{
+#ifndef SP_CODA
+ NSString *returnValue = nil;
+
+ NSString *identifier = [tableColumn identifier];
+
+ if (!identifier) return returnValue;
+
+ id object = [[messagesVisibleSet objectAtIndex:row] valueForKey:identifier];
+
+ if ([[tableColumn identifier] isEqualToString:SPTableViewDateColumnID]) {
+
+ returnValue = [dateFormatter stringFromDate:(NSDate *)object];
+ }
+ else {
+ if ([(NSString *)object length] > SPMessageTruncateCharacterLength) {
+ object = [NSString stringWithFormat:@"%@...", [object substringToIndex:SPMessageTruncateCharacterLength]];
+ }
+
+ returnValue = object;
+ }
+
+ if (!returnValue) return returnValue;
+
+ NSMutableDictionary *stringAtributes = nil;
+
+ if (consoleFont) {
+ stringAtributes = [NSMutableDictionary dictionaryWithObject:consoleFont forKey:NSFontAttributeName];
+ }
+
+ // If this is an error message give it a red colour
+ if ([(SPConsoleMessage *)[messagesVisibleSet objectAtIndex:row] isError]) {
+ if (stringAtributes) {
+ [stringAtributes setObject:[NSColor redColor] forKey:NSForegroundColorAttributeName];
+ }
+ else {
+ stringAtributes = [NSMutableDictionary dictionaryWithObject:[NSColor redColor] forKey:NSForegroundColorAttributeName];
+ }
+ }
+
+ return [[[NSAttributedString alloc] initWithString:returnValue attributes:stringAtributes] autorelease];
+#else
+ return nil;
+#endif
+}
+
+- (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard
+{
+ NSString *string = [self sqlStringForRowIndexes:rowIndexes];
+ if([string length]) {
+ [pboard declareTypes:@[NSStringPboardType] owner:self];
+ return [pboard setString:string forType:NSStringPboardType];
+ }
+
+ return NO;
+}
+
+#pragma mark - SPQueryDocumentsController
+
+- (NSURL *)registerDocumentWithFileURL:(NSURL *)fileURL andContextInfo:(NSMutableDictionary *)contextInfo
+{
+#ifndef SP_CODA
+ // Register a new untiled document and return its URL
+ if (fileURL == nil) {
+ NSURL *new = [NSURL URLWithString:[[NSString stringWithFormat:NSLocalizedString(@"Untitled %ld",@"Title of a new Sequel Pro Document"), (unsigned long)untitledDocumentCounter] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
+ untitledDocumentCounter++;
+
+ if (![favoritesContainer objectForKey:[new absoluteString]]) {
+ NSMutableArray *arr = [[NSMutableArray alloc] init];
+ [favoritesContainer setObject:arr forKey:[new absoluteString]];
+ [arr release];
+ }
+
+ // Set the global history coming from the Prefs as default if available
+ if (![historyContainer objectForKey:[new absoluteString]]) {
+ if ([prefs objectForKey:SPQueryHistory]) {
+ NSMutableArray *arr = [[NSMutableArray alloc] init];
+ [arr addObjectsFromArray:[prefs objectForKey:SPQueryHistory]];
+ [historyContainer setObject:arr forKey:[new absoluteString]];
+ [arr release];
+ }
+ else {
+ NSMutableArray *arr = [[NSMutableArray alloc] init];
+ [historyContainer setObject:[NSMutableArray array] forKey:[new absoluteString]];
+ [arr release];
+ }
+ }
+
+ // Set the doc-based content filters
+ if (![contentFilterContainer objectForKey:[new absoluteString]]) {
+ [contentFilterContainer setObject:[NSMutableDictionary dictionary] forKey:[new absoluteString]];
+ }
+
+ return new;
+ }
+
+ // Register a spf file to manage all query favorites and query history items
+ // file path based (incl. Untitled docs) in a dictionary whereby the key represents the file URL as string.
+ if (![favoritesContainer objectForKey:[fileURL absoluteString]]) {
+ if (contextInfo != nil && [contextInfo objectForKey:SPQueryFavorites] && [[contextInfo objectForKey:SPQueryFavorites] count]) {
+ NSMutableArray *arr = [[NSMutableArray alloc] init];
+ [arr addObjectsFromArray:[contextInfo objectForKey:SPQueryFavorites]];
+ [favoritesContainer setObject:arr forKey:[fileURL absoluteString]];
+ [arr release];
+ }
+ else {
+ NSMutableArray *arr = [[NSMutableArray alloc] init];
+ [favoritesContainer setObject:arr forKey:[fileURL absoluteString]];
+ [arr release];
+ }
+ }
+
+ if (![historyContainer objectForKey:[fileURL absoluteString]]) {
+ if (contextInfo != nil && [contextInfo objectForKey:SPQueryHistory] && [[contextInfo objectForKey:SPQueryHistory] count]) {
+ NSMutableArray *arr = [[NSMutableArray alloc] init];
+ [arr addObjectsFromArray:[contextInfo objectForKey:SPQueryHistory]];
+ [historyContainer setObject:arr forKey:[fileURL absoluteString]];
+ [arr release];
+ }
+ else {
+ NSMutableArray *arr = [[NSMutableArray alloc] init];
+ [historyContainer setObject:arr forKey:[fileURL absoluteString]];
+ [arr release];
+ }
+ }
+
+ if (![contentFilterContainer objectForKey:[fileURL absoluteString]]) {
+ if (contextInfo != nil && [contextInfo objectForKey:SPContentFilters]) {
+ [contentFilterContainer setObject:[contextInfo objectForKey:SPContentFilters] forKey:[fileURL absoluteString]];
+ }
+ else {
+ NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
+ [contentFilterContainer setObject:dict forKey:[fileURL absoluteString]];
+ [dict release];
+ }
+ }
+
+ return fileURL;
+#else
+ return nil;
+#endif
+}
+
+- (void)removeRegisteredDocumentWithFileURL:(NSURL *)fileURL
+{
+#ifndef SP_CODA
+ // Check for multiple instance of the same document.
+ // Remove it if only one instance was registerd.
+ NSArray *allDocs = [SPAppDelegate orderedDocuments];
+ NSMutableArray *allURLs = [NSMutableArray array];
+
+ for (id doc in allDocs)
+ {
+ if (![doc fileURL]) continue;
+
+ if ([allURLs containsObject:[doc fileURL]]) {
+ return;
+ }
+ else {
+ [allURLs addObject:[doc fileURL]];
+ }
+ }
+
+ if ([favoritesContainer objectForKey:[fileURL absoluteString]]) {
+ [favoritesContainer removeObjectForKey:[fileURL absoluteString]];
+ }
+
+ if ([historyContainer objectForKey:[fileURL absoluteString]]) {
+ [historyContainer removeObjectForKey:[fileURL absoluteString]];
+ }
+
+ if ([contentFilterContainer objectForKey:[fileURL absoluteString]]) {
+ [contentFilterContainer removeObjectForKey:[fileURL absoluteString]];
+ }
+#endif
+}
+
+- (void)replaceContentFilterByArray:(NSArray *)contentFilterArray ofType:(NSString *)filterType forFileURL:(NSURL *)fileURL
+{
+#ifndef SP_CODA
+ if ([contentFilterContainer objectForKey:[fileURL absoluteString]]) {
+ NSMutableDictionary *c = [[NSMutableDictionary alloc] init];
+ [c setDictionary:[contentFilterContainer objectForKey:[fileURL absoluteString]]];
+ [c setObject:contentFilterArray forKey:filterType];
+ [contentFilterContainer setObject:c forKey:[fileURL absoluteString]];
+ [c release];
+ }
+#endif
+}
+
+- (void)replaceFavoritesByArray:(NSArray *)favoritesArray forFileURL:(NSURL *)fileURL
+{
+#ifndef SP_CODA
+ if ([favoritesContainer objectForKey:[fileURL absoluteString]]) {
+ [favoritesContainer setObject:favoritesArray forKey:[fileURL absoluteString]];
+ }
+#endif
+}
+
+/**
+ * Remove a Query Favorite the passed file URL
+ *
+ * @param index The index of the to be removed favorite
+ *
+ * @param fileURL The NSURL of the current active SPDatabaseDocument
+ */
+- (void)removeFavoriteAtIndex:(NSUInteger)index forFileURL:(NSURL *)fileURL
+{
+#ifndef SP_CODA
+ [[favoritesContainer objectForKey:[fileURL absoluteString]] removeObjectAtIndex:index];
+#endif
+}
+
+- (void)insertFavorite:(NSDictionary *)favorite atIndex:(NSUInteger)index forFileURL:(NSURL *)fileURL
+{
+#ifndef SP_CODA
+ [[favoritesContainer objectForKey:[fileURL absoluteString]] insertObject:favorite atIndex:index];
+#endif
+}
+
+- (void)replaceHistoryByArray:(NSArray *)historyArray forFileURL:(NSURL *)fileURL
+{
+#ifndef SP_CODA
+ if ([historyContainer objectForKey:[fileURL absoluteString]]) {
+ [historyContainer setObject:historyArray forKey:[fileURL absoluteString]];
+ }
+
+ // Inform all opened documents to update the history list
+ for (id doc in [SPAppDelegate orderedDocuments])
+ {
+ if([[doc valueForKeyPath:@"customQueryInstance"] respondsToSelector:@selector(historyItemsHaveBeenUpdated:)]) {
+ [[doc valueForKeyPath:@"customQueryInstance"] performSelectorOnMainThread:@selector(historyItemsHaveBeenUpdated:) withObject:self waitUntilDone:NO];
+ }
+ }
+
+ // User did choose to clear the global history list
+ if (![fileURL isFileURL] && ![historyArray count]) {
+ [prefs setObject:historyArray forKey:SPQueryHistory];
+ }
+#endif
+}
+
+- (void)addFavorite:(NSDictionary *)favorite forFileURL:(NSURL *)fileURL
+{
+#ifndef SP_CODA
+ if ([favoritesContainer objectForKey:[fileURL absoluteString]]) {
+ [[favoritesContainer objectForKey:[fileURL absoluteString]] addObject:favorite];
+ }
+#endif
+}
+
+- (void)addHistory:(NSString *)history forFileURL:(NSURL *)fileURL
+{
+#ifndef SP_CODA
+ NSUInteger maxHistoryItems = [[prefs objectForKey:SPCustomQueryMaxHistoryItems] integerValue];
+
+ // Save each history item due to its document source
+ if ([historyContainer objectForKey:[fileURL absoluteString]]) {
+
+ // Remove all duplicates by using a NSPopUpButton
+ NSPopUpButton *uniquifier = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(0,0,0,0) pullsDown:YES];
+
+ [uniquifier addItemsWithTitles:[historyContainer objectForKey:[fileURL absoluteString]]];
+ [uniquifier insertItemWithTitle:history atIndex:0];
+
+ while ((NSUInteger)[uniquifier numberOfItems] > maxHistoryItems)
+ {
+ [uniquifier removeItemAtIndex:[uniquifier numberOfItems]-1];
+ }
+
+ [self replaceHistoryByArray:[uniquifier itemTitles] forFileURL:fileURL];
+ [uniquifier release];
+ }
+
+ // Save history items coming from each Untitled document in the global Preferences successively
+ // regardingless of the source document.
+ if (![fileURL isFileURL]) {
+
+ // Remove all duplicates by using a NSPopUpButton
+ NSPopUpButton *uniquifier = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(0,0,0,0) pullsDown:YES];
+ [uniquifier addItemsWithTitles:[prefs objectForKey:SPQueryHistory]];
+ [uniquifier insertItemWithTitle:history atIndex:0];
+
+ while ((NSUInteger)[uniquifier numberOfItems] > maxHistoryItems)
+ {
+ [uniquifier removeItemAtIndex:[uniquifier numberOfItems] - 1];
+ }
+
+ [prefs setObject:[uniquifier itemTitles] forKey:SPQueryHistory];
+ [uniquifier release];
+ }
+#endif
+}
+
+- (NSMutableArray *)favoritesForFileURL:(NSURL *)fileURL
+{
+#ifndef SP_CODA
+ if ([favoritesContainer objectForKey:[fileURL absoluteString]]) {
+ return [favoritesContainer objectForKey:[fileURL absoluteString]];
+ }
+#endif
+
+ return [NSMutableArray array];
+}
+
+- (NSMutableArray *)historyForFileURL:(NSURL *)fileURL
+{
+#ifndef SP_CODA
+ if ([historyContainer objectForKey:[fileURL absoluteString]]) {
+ return [historyContainer objectForKey:[fileURL absoluteString]];
+ }
+#endif
+
+ return [NSMutableArray array];
+}
+
+- (NSArray *)historyMenuItemsForFileURL:(NSURL *)fileURL
+{
+#ifndef SP_CODA
+ if ([historyContainer objectForKey:[fileURL absoluteString]]) {
+ NSMutableArray *returnArray = [NSMutableArray arrayWithCapacity:[[historyContainer objectForKey:[fileURL absoluteString]] count]];
+ NSMenuItem *historyMenuItem;
+
+ for (NSString* history in [historyContainer objectForKey:[fileURL absoluteString]])
+ {
+ historyMenuItem = [[[NSMenuItem alloc] initWithTitle:([history length] > 64) ? [NSString stringWithFormat:@"%@…", [history substringToIndex:63]] : history
+ action:NULL
+ keyEquivalent:@""] autorelease];
+
+ [historyMenuItem setToolTip:([history length] > 256) ? [NSString stringWithFormat:@"%@…", [history substringToIndex:255]] : history];
+ [returnArray addObject:historyMenuItem];
+ }
+
+ return returnArray;
+ }
+#endif
+
+ return @[];
+}
+
+/**
+ * Return the number of history items for the passed file URL
+ *
+ * @param fileURL The NSURL of the current active SPDatabaseDocument
+ *
+ */
+- (NSUInteger)numberOfHistoryItemsForFileURL:(NSURL *)fileURL
+{
+#ifndef SP_CODA
+ if ([historyContainer objectForKey:[fileURL absoluteString]]) {
+ return [[historyContainer objectForKey:[fileURL absoluteString]] count];
+ }
+ else {
+ return 0;
+ }
+#endif
+
+ return 0;
+}
+
+/**
+ * Return a mutable dictionary of all content filters for the passed file URL.
+ * If no content filters were found it returns an empty mutable dictionary.
+ *
+ * @param fileURL The NSURL of the current active SPDatabaseDocument
+ *
+ */
+- (NSMutableDictionary *)contentFilterForFileURL:(NSURL *)fileURL
+{
+#ifndef SP_CODA
+ if ([contentFilterContainer objectForKey:[fileURL absoluteString]]) {
+ return [contentFilterContainer objectForKey:[fileURL absoluteString]];
+ }
+#endif
+
+ return [NSMutableDictionary dictionary];
+}
+
+- (NSArray *)queryFavoritesForFileURL:(NSURL *)fileURL andTabTrigger:(NSString *)tabTrigger includeGlobals:(BOOL)includeGlobals
+{
+ if (![tabTrigger length]) return @[];
+
+ NSMutableArray *result = [[NSMutableArray alloc] init];
+
+ for (id fav in [self favoritesForFileURL:fileURL])
+ {
+ if ([fav objectForKey:@"tabtrigger"] && [[fav objectForKey:@"tabtrigger"] isEqualToString:tabTrigger]) {
+ [result addObject:fav];
+ }
+ }
+
+#ifndef SP_CODA
+ if (includeGlobals && [prefs objectForKey:SPQueryFavorites]) {
+
+ for (id fav in [prefs objectForKey:SPQueryFavorites])
+ {
+ if ([fav objectForKey:@"tabtrigger"] && [[fav objectForKey:@"tabtrigger"] isEqualToString:tabTrigger]) {
+ [result addObject:fav];
+ break;
+ }
+ }
+ }
+#endif
+
+ return [result autorelease];
+}
+
+#pragma mark -
+#pragma mark Completion list controller
+
+/**
+ * Return an array of all pre-defined SQL functions for completion.
+ */
+- (NSArray*)functionList
+{
+ return (completionFunctionList != nil && [completionFunctionList count]) ? completionFunctionList : @[];
+}
+
+/**
+ * Return an array of all pre-defined SQL keywords for completion.
+ */
+- (NSArray*)keywordList
+{
+ return (completionKeywordList != nil && [completionKeywordList count]) ? completionKeywordList : @[];
+}
+
+/**
+ * Return the parameter list as snippet of the passed SQL functions for completion.
+ *
+ * @param func The name of the function whose parameter list is asked for
+ */
+- (NSString*)argumentSnippetForFunction:(NSString*)func
+{
+ return (functionArgumentSnippets && [functionArgumentSnippets objectForKey:[func uppercaseString]]) ? [functionArgumentSnippets objectForKey:[func uppercaseString]] : @"";
+}
+
#pragma mark -
- (void)dealloc
diff --git a/Source/SPQueryControllerInitializer.h b/Source/SPQueryControllerInitializer.h
deleted file mode 100644
index fa082a90..00000000
--- a/Source/SPQueryControllerInitializer.h
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// SPQueryControllerInitializer.h
-// sequel-pro
-//
-// Created by Stuart Connolly (stuconnolly.com) on September 1, 2011.
-// Copyright (c) 2011 Stuart Connolly. All rights reserved.
-//
-// Permission is hereby granted, free of charge, to any person
-// obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without
-// restriction, including without limitation the rights to use,
-// copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following
-// conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-// More info at <https://github.com/sequelpro/sequelpro>
-
-#import "SPQueryController.h"
-
-@interface SPQueryController (SPQueryControllerInitializer)
-
-- (NSError *)loadCompletionLists;
-
-@end
diff --git a/Source/SPQueryControllerInitializer.m b/Source/SPQueryControllerInitializer.m
deleted file mode 100644
index f8292b37..00000000
--- a/Source/SPQueryControllerInitializer.m
+++ /dev/null
@@ -1,145 +0,0 @@
-//
-// SPQueryControllerInitializer.m
-// sequel-pro
-//
-// Created by Stuart Connolly (stuconnolly.com) on September 1, 2011.
-// Copyright (c) 2011 Stuart Connolly. All rights reserved.
-//
-// Permission is hereby granted, free of charge, to any person
-// obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without
-// restriction, including without limitation the rights to use,
-// copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following
-// conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-// More info at <https://github.com/sequelpro/sequelpro>
-
-#import "SPQueryControllerInitializer.h"
-
-static NSString *SPCompletionTokensFilename = @"CompletionTokens.plist";
-
-static NSString *SPCompletionTokensKeywordsKey = @"core_keywords";
-static NSString *SPCompletionTokensFunctionsKey = @"core_builtin_functions";
-static NSString *SPCompletionTokensSnippetsKey = @"function_argument_snippets";
-
-@interface SPQueryController ()
-
-- (void)_updateFilterState;
-
-@end
-
-@implementation SPQueryController (SPQueryControllerInitializer)
-
-/**
- * Set the window's auto save name and initialise display.
- */
-- (void)awakeFromNib
-{
-#ifndef SP_CODA /* init ivars */
- prefs = [NSUserDefaults standardUserDefaults];
-
- [self setWindowFrameAutosaveName:SPQueryConsoleWindowAutoSaveName];
-
- // Show/hide table columns
- [[consoleTableView tableColumnWithIdentifier:SPTableViewDateColumnID] setHidden:![prefs boolForKey:SPConsoleShowTimestamps]];
- [[consoleTableView tableColumnWithIdentifier:SPTableViewConnectionColumnID] setHidden:![prefs boolForKey:SPConsoleShowConnections]];
- [[consoleTableView tableColumnWithIdentifier:SPTableViewDatabaseColumnID] setHidden:![prefs boolForKey:SPConsoleShowDatabases]];
-
- showSelectStatementsAreDisabled = ![prefs boolForKey:SPConsoleShowSelectsAndShows];
- showHelpStatementsAreDisabled = ![prefs boolForKey:SPConsoleShowHelps];
-
- [self _updateFilterState];
-
- [loggingDisabledTextField setStringValue:([prefs boolForKey:SPConsoleEnableLogging]) ? @"" : NSLocalizedString(@"Query logging is currently disabled", @"query logging disabled label")];
-
- // Setup data formatter
- dateFormatter = [[NSDateFormatter alloc] init];
-
- [dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
-
- [dateFormatter setDateStyle:NSDateFormatterNoStyle];
- [dateFormatter setTimeStyle:NSDateFormatterMediumStyle];
-
- // Set the process table view's vertical gridlines if required
- [consoleTableView setGridStyleMask:([prefs boolForKey:SPDisplayTableViewVerticalGridlines]) ? NSTableViewSolidVerticalGridLineMask : NSTableViewGridNone];
-
- // Set the strutcture and index view's font
- BOOL useMonospacedFont = [prefs boolForKey:SPUseMonospacedFonts];
- CGFloat monospacedFontSize = [prefs floatForKey:SPMonospacedFontSize] > 0 ? [prefs floatForKey:SPMonospacedFontSize] : [NSFont smallSystemFontSize];
-
- for (NSTableColumn *column in [consoleTableView tableColumns])
- {
- [[column dataCell] setFont:(useMonospacedFont) ? [NSFont fontWithName:SPDefaultMonospacedFontName size:monospacedFontSize] : [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
- }
-
- //allow drag-out copying of selected rows
- [consoleTableView setDraggingSourceOperationMask:NSDragOperationCopy forLocal:NO];
-#endif
-}
-
-/**
- * Loads the query controller's completion tokens data.
- */
-- (NSError *)loadCompletionLists
-{
- NSError *readError = nil;
- NSString *convError = nil;
- NSString *errorDescription = nil;
-
- NSPropertyListFormat format;
- NSData *completionTokensData = [NSData dataWithContentsOfFile:
- [NSBundle pathForResource:SPCompletionTokensFilename
- ofType:nil
- inDirectory:[[NSBundle mainBundle] bundlePath]]
- options:NSMappedRead error:&readError];
-
- NSDictionary *completionPlist = [NSDictionary dictionaryWithDictionary:
- [NSPropertyListSerialization propertyListFromData:completionTokensData
- mutabilityOption:NSPropertyListMutableContainersAndLeaves
- format:&format
- errorDescription:&convError]];
-
- if (completionPlist == nil || readError != nil || convError != nil) {
- errorDescription = [NSString stringWithFormat:@"Error reading '%@': %@, %@", SPCompletionTokensFilename, [readError localizedDescription], convError];
- }
- else {
- if ([completionPlist objectForKey:SPCompletionTokensKeywordsKey]) {
- completionKeywordList = [[NSArray arrayWithArray:[completionPlist objectForKey:SPCompletionTokensKeywordsKey]] retain];
- }
- else {
- errorDescription = [NSString stringWithFormat:@"No '%@' array found.", SPCompletionTokensKeywordsKey];
- }
-
- if ([completionPlist objectForKey:SPCompletionTokensFunctionsKey]) {
- completionFunctionList = [[NSArray arrayWithArray:[completionPlist objectForKey:SPCompletionTokensFunctionsKey]] retain];
- }
- else {
- errorDescription = [NSString stringWithFormat:@"No '%@' array found.", SPCompletionTokensFunctionsKey];
- }
-
- if ([completionPlist objectForKey:SPCompletionTokensSnippetsKey]) {
- functionArgumentSnippets = [[NSDictionary dictionaryWithDictionary:[completionPlist objectForKey:SPCompletionTokensSnippetsKey]] retain];
- }
- else {
- errorDescription = [NSString stringWithFormat:@"No '%@' dictionary found.", SPCompletionTokensSnippetsKey];
- }
- }
-
- return errorDescription ? [NSError errorWithDomain:NSCocoaErrorDomain code:1 userInfo:@{NSLocalizedDescriptionKey : errorDescription}] : nil;
-}
-
-@end
diff --git a/Source/SPQueryDocumentsController.h b/Source/SPQueryDocumentsController.h
deleted file mode 100644
index a57eff2e..00000000
--- a/Source/SPQueryDocumentsController.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// SPQueryDocumentsController.h
-// sequel-pro
-//
-// Created by Stuart Connolly (stuconnolly.com) on August 30, 2011.
-// Copyright (c) 2011 Stuart Connolly. All rights reserved.
-//
-// Permission is hereby granted, free of charge, to any person
-// obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without
-// restriction, including without limitation the rights to use,
-// copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following
-// conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-// More info at <https://github.com/sequelpro/sequelpro>
-
-#import "SPQueryController.h"
-
-@interface SPQueryController (SPQueryDocumentsController)
-
-- (NSURL *)registerDocumentWithFileURL:(NSURL *)fileURL andContextInfo:(NSMutableDictionary *)contextInfo;
-- (void)removeRegisteredDocumentWithFileURL:(NSURL *)fileURL;
-
-- (void)addFavorite:(NSDictionary *)favorite forFileURL:(NSURL *)fileURL;
-- (void)replaceFavoritesByArray:(NSArray *)favoritesArray forFileURL:(NSURL *)fileURL;
-- (void)removeFavoriteAtIndex:(NSUInteger)index forFileURL:(NSURL *)fileURL;
-- (void)insertFavorite:(NSDictionary *)favorite atIndex:(NSUInteger)index forFileURL:(NSURL *)fileURL;
-
-- (void)addHistory:(NSString *)history forFileURL:(NSURL *)fileURL;
-- (void)replaceHistoryByArray:(NSArray *)historyArray forFileURL:(NSURL *)fileURL;
-
-- (void)replaceContentFilterByArray:(NSArray *)contentFilterArray ofType:(NSString *)filterType forFileURL:(NSURL *)fileURL;
-
-- (NSMutableArray *)favoritesForFileURL:(NSURL *)fileURL;
-- (NSMutableArray *)historyForFileURL:(NSURL *)fileURL;
-- (NSArray *)historyMenuItemsForFileURL:(NSURL *)fileURL;
-- (NSUInteger)numberOfHistoryItemsForFileURL:(NSURL *)fileURL;
-- (NSMutableDictionary *)contentFilterForFileURL:(NSURL *)fileURL;
-
-- (NSArray *)queryFavoritesForFileURL:(NSURL *)fileURL andTabTrigger:(NSString *)tabTrigger includeGlobals:(BOOL)includeGlobals;
-
-// Completion list controller
-- (NSArray*)functionList;
-- (NSArray*)keywordList;
-- (NSString*)argumentSnippetForFunction:(NSString*)func;
-
-@end
diff --git a/Source/SPQueryDocumentsController.m b/Source/SPQueryDocumentsController.m
deleted file mode 100644
index e4689c41..00000000
--- a/Source/SPQueryDocumentsController.m
+++ /dev/null
@@ -1,414 +0,0 @@
-//
-// SPQueryDocumentsController.m
-// sequel-pro
-//
-// Created by Stuart Connolly (stuconnolly.com) on August 30, 2011.
-// Copyright (c) 2011 Stuart Connolly. All rights reserved.
-//
-// Permission is hereby granted, free of charge, to any person
-// obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without
-// restriction, including without limitation the rights to use,
-// copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following
-// conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-// More info at <https://github.com/sequelpro/sequelpro>
-
-#import "SPQueryDocumentsController.h"
-#import "SPCustomQuery.h"
-#import "SPAppController.h"
-
-@implementation SPQueryController (SPQueryDocumentsController)
-
-- (NSURL *)registerDocumentWithFileURL:(NSURL *)fileURL andContextInfo:(NSMutableDictionary *)contextInfo
-{
-#ifndef SP_CODA
- // Register a new untiled document and return its URL
- if (fileURL == nil) {
- NSURL *new = [NSURL URLWithString:[[NSString stringWithFormat:NSLocalizedString(@"Untitled %ld",@"Title of a new Sequel Pro Document"), (unsigned long)untitledDocumentCounter] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
- untitledDocumentCounter++;
-
- if (![favoritesContainer objectForKey:[new absoluteString]]) {
- NSMutableArray *arr = [[NSMutableArray alloc] init];
- [favoritesContainer setObject:arr forKey:[new absoluteString]];
- [arr release];
- }
-
- // Set the global history coming from the Prefs as default if available
- if (![historyContainer objectForKey:[new absoluteString]]) {
- if ([prefs objectForKey:SPQueryHistory]) {
- NSMutableArray *arr = [[NSMutableArray alloc] init];
- [arr addObjectsFromArray:[prefs objectForKey:SPQueryHistory]];
- [historyContainer setObject:arr forKey:[new absoluteString]];
- [arr release];
- }
- else {
- NSMutableArray *arr = [[NSMutableArray alloc] init];
- [historyContainer setObject:[NSMutableArray array] forKey:[new absoluteString]];
- [arr release];
- }
- }
-
- // Set the doc-based content filters
- if (![contentFilterContainer objectForKey:[new absoluteString]]) {
- [contentFilterContainer setObject:[NSMutableDictionary dictionary] forKey:[new absoluteString]];
- }
-
- return new;
- }
-
- // Register a spf file to manage all query favorites and query history items
- // file path based (incl. Untitled docs) in a dictionary whereby the key represents the file URL as string.
- if (![favoritesContainer objectForKey:[fileURL absoluteString]]) {
- if (contextInfo != nil && [contextInfo objectForKey:SPQueryFavorites] && [[contextInfo objectForKey:SPQueryFavorites] count]) {
- NSMutableArray *arr = [[NSMutableArray alloc] init];
- [arr addObjectsFromArray:[contextInfo objectForKey:SPQueryFavorites]];
- [favoritesContainer setObject:arr forKey:[fileURL absoluteString]];
- [arr release];
- }
- else {
- NSMutableArray *arr = [[NSMutableArray alloc] init];
- [favoritesContainer setObject:arr forKey:[fileURL absoluteString]];
- [arr release];
- }
- }
-
- if (![historyContainer objectForKey:[fileURL absoluteString]]) {
- if (contextInfo != nil && [contextInfo objectForKey:SPQueryHistory] && [[contextInfo objectForKey:SPQueryHistory] count]) {
- NSMutableArray *arr = [[NSMutableArray alloc] init];
- [arr addObjectsFromArray:[contextInfo objectForKey:SPQueryHistory]];
- [historyContainer setObject:arr forKey:[fileURL absoluteString]];
- [arr release];
- }
- else {
- NSMutableArray *arr = [[NSMutableArray alloc] init];
- [historyContainer setObject:arr forKey:[fileURL absoluteString]];
- [arr release];
- }
- }
-
- if (![contentFilterContainer objectForKey:[fileURL absoluteString]]) {
- if (contextInfo != nil && [contextInfo objectForKey:SPContentFilters]) {
- [contentFilterContainer setObject:[contextInfo objectForKey:SPContentFilters] forKey:[fileURL absoluteString]];
- }
- else {
- NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
- [contentFilterContainer setObject:dict forKey:[fileURL absoluteString]];
- [dict release];
- }
- }
-
- return fileURL;
-#else
- return nil;
-#endif
-}
-
-- (void)removeRegisteredDocumentWithFileURL:(NSURL *)fileURL
-{
-#ifndef SP_CODA
- // Check for multiple instance of the same document.
- // Remove it if only one instance was registerd.
- NSArray *allDocs = [SPAppDelegate orderedDocuments];
- NSMutableArray *allURLs = [NSMutableArray array];
-
- for (id doc in allDocs)
- {
- if (![doc fileURL]) continue;
-
- if ([allURLs containsObject:[doc fileURL]]) {
- return;
- }
- else {
- [allURLs addObject:[doc fileURL]];
- }
- }
-
- if ([favoritesContainer objectForKey:[fileURL absoluteString]]) {
- [favoritesContainer removeObjectForKey:[fileURL absoluteString]];
- }
-
- if ([historyContainer objectForKey:[fileURL absoluteString]]) {
- [historyContainer removeObjectForKey:[fileURL absoluteString]];
- }
-
- if ([contentFilterContainer objectForKey:[fileURL absoluteString]]) {
- [contentFilterContainer removeObjectForKey:[fileURL absoluteString]];
- }
-#endif
-}
-
-- (void)replaceContentFilterByArray:(NSArray *)contentFilterArray ofType:(NSString *)filterType forFileURL:(NSURL *)fileURL
-{
-#ifndef SP_CODA
- if ([contentFilterContainer objectForKey:[fileURL absoluteString]]) {
- NSMutableDictionary *c = [[NSMutableDictionary alloc] init];
- [c setDictionary:[contentFilterContainer objectForKey:[fileURL absoluteString]]];
- [c setObject:contentFilterArray forKey:filterType];
- [contentFilterContainer setObject:c forKey:[fileURL absoluteString]];
- [c release];
- }
-#endif
-}
-
-- (void)replaceFavoritesByArray:(NSArray *)favoritesArray forFileURL:(NSURL *)fileURL
-{
-#ifndef SP_CODA
- if ([favoritesContainer objectForKey:[fileURL absoluteString]]) {
- [favoritesContainer setObject:favoritesArray forKey:[fileURL absoluteString]];
- }
-#endif
-}
-
-/**
- * Remove a Query Favorite the passed file URL
- *
- * @param index The index of the to be removed favorite
- *
- * @param fileURL The NSURL of the current active SPDatabaseDocument
- */
-- (void)removeFavoriteAtIndex:(NSUInteger)index forFileURL:(NSURL *)fileURL
-{
-#ifndef SP_CODA
- [[favoritesContainer objectForKey:[fileURL absoluteString]] removeObjectAtIndex:index];
-#endif
-}
-
-- (void)insertFavorite:(NSDictionary *)favorite atIndex:(NSUInteger)index forFileURL:(NSURL *)fileURL
-{
-#ifndef SP_CODA
- [[favoritesContainer objectForKey:[fileURL absoluteString]] insertObject:favorite atIndex:index];
-#endif
-}
-
-- (void)replaceHistoryByArray:(NSArray *)historyArray forFileURL:(NSURL *)fileURL
-{
-#ifndef SP_CODA
- if ([historyContainer objectForKey:[fileURL absoluteString]]) {
- [historyContainer setObject:historyArray forKey:[fileURL absoluteString]];
- }
-
- // Inform all opened documents to update the history list
- for (id doc in [SPAppDelegate orderedDocuments])
- {
- if([[doc valueForKeyPath:@"customQueryInstance"] respondsToSelector:@selector(historyItemsHaveBeenUpdated:)]) {
- [[doc valueForKeyPath:@"customQueryInstance"] performSelectorOnMainThread:@selector(historyItemsHaveBeenUpdated:) withObject:self waitUntilDone:NO];
- }
- }
-
- // User did choose to clear the global history list
- if (![fileURL isFileURL] && ![historyArray count]) {
- [prefs setObject:historyArray forKey:SPQueryHistory];
- }
-#endif
-}
-
-- (void)addFavorite:(NSDictionary *)favorite forFileURL:(NSURL *)fileURL
-{
-#ifndef SP_CODA
- if ([favoritesContainer objectForKey:[fileURL absoluteString]]) {
- [[favoritesContainer objectForKey:[fileURL absoluteString]] addObject:favorite];
- }
-#endif
-}
-
-- (void)addHistory:(NSString *)history forFileURL:(NSURL *)fileURL
-{
-#ifndef SP_CODA
- NSUInteger maxHistoryItems = [[prefs objectForKey:SPCustomQueryMaxHistoryItems] integerValue];
-
- // Save each history item due to its document source
- if ([historyContainer objectForKey:[fileURL absoluteString]]) {
-
- // Remove all duplicates by using a NSPopUpButton
- NSPopUpButton *uniquifier = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(0,0,0,0) pullsDown:YES];
-
- [uniquifier addItemsWithTitles:[historyContainer objectForKey:[fileURL absoluteString]]];
- [uniquifier insertItemWithTitle:history atIndex:0];
-
- while ((NSUInteger)[uniquifier numberOfItems] > maxHistoryItems)
- {
- [uniquifier removeItemAtIndex:[uniquifier numberOfItems]-1];
- }
-
- [self replaceHistoryByArray:[uniquifier itemTitles] forFileURL:fileURL];
- [uniquifier release];
- }
-
- // Save history items coming from each Untitled document in the global Preferences successively
- // regardingless of the source document.
- if (![fileURL isFileURL]) {
-
- // Remove all duplicates by using a NSPopUpButton
- NSPopUpButton *uniquifier = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(0,0,0,0) pullsDown:YES];
- [uniquifier addItemsWithTitles:[prefs objectForKey:SPQueryHistory]];
- [uniquifier insertItemWithTitle:history atIndex:0];
-
- while ((NSUInteger)[uniquifier numberOfItems] > maxHistoryItems)
- {
- [uniquifier removeItemAtIndex:[uniquifier numberOfItems] - 1];
- }
-
- [prefs setObject:[uniquifier itemTitles] forKey:SPQueryHistory];
- [uniquifier release];
- }
-#endif
-}
-
-- (NSMutableArray *)favoritesForFileURL:(NSURL *)fileURL
-{
-#ifndef SP_CODA
- if ([favoritesContainer objectForKey:[fileURL absoluteString]]) {
- return [favoritesContainer objectForKey:[fileURL absoluteString]];
- }
-#endif
-
- return [NSMutableArray array];
-}
-
-- (NSMutableArray *)historyForFileURL:(NSURL *)fileURL
-{
-#ifndef SP_CODA
- if ([historyContainer objectForKey:[fileURL absoluteString]]) {
- return [historyContainer objectForKey:[fileURL absoluteString]];
- }
-#endif
-
- return [NSMutableArray array];
-}
-
-- (NSArray *)historyMenuItemsForFileURL:(NSURL *)fileURL
-{
-#ifndef SP_CODA
- if ([historyContainer objectForKey:[fileURL absoluteString]]) {
- NSMutableArray *returnArray = [NSMutableArray arrayWithCapacity:[[historyContainer objectForKey:[fileURL absoluteString]] count]];
- NSMenuItem *historyMenuItem;
-
- for (NSString* history in [historyContainer objectForKey:[fileURL absoluteString]])
- {
- historyMenuItem = [[[NSMenuItem alloc] initWithTitle:([history length] > 64) ? [NSString stringWithFormat:@"%@…", [history substringToIndex:63]] : history
- action:NULL
- keyEquivalent:@""] autorelease];
-
- [historyMenuItem setToolTip:([history length] > 256) ? [NSString stringWithFormat:@"%@…", [history substringToIndex:255]] : history];
- [returnArray addObject:historyMenuItem];
- }
-
- return returnArray;
- }
-#endif
-
- return @[];
-}
-
-/**
- * Return the number of history items for the passed file URL
- *
- * @param fileURL The NSURL of the current active SPDatabaseDocument
- *
- */
-- (NSUInteger)numberOfHistoryItemsForFileURL:(NSURL *)fileURL
-{
-#ifndef SP_CODA
- if ([historyContainer objectForKey:[fileURL absoluteString]]) {
- return [[historyContainer objectForKey:[fileURL absoluteString]] count];
- }
- else {
- return 0;
- }
-#endif
-
- return 0;
-}
-
-/**
- * Return a mutable dictionary of all content filters for the passed file URL.
- * If no content filters were found it returns an empty mutable dictionary.
- *
- * @param fileURL The NSURL of the current active SPDatabaseDocument
- *
- */
-- (NSMutableDictionary *)contentFilterForFileURL:(NSURL *)fileURL
-{
-#ifndef SP_CODA
- if ([contentFilterContainer objectForKey:[fileURL absoluteString]]) {
- return [contentFilterContainer objectForKey:[fileURL absoluteString]];
- }
-#endif
-
- return [NSMutableDictionary dictionary];
-}
-
-- (NSArray *)queryFavoritesForFileURL:(NSURL *)fileURL andTabTrigger:(NSString *)tabTrigger includeGlobals:(BOOL)includeGlobals
-{
- if (![tabTrigger length]) return @[];
-
- NSMutableArray *result = [[NSMutableArray alloc] init];
-
- for (id fav in [self favoritesForFileURL:fileURL])
- {
- if ([fav objectForKey:@"tabtrigger"] && [[fav objectForKey:@"tabtrigger"] isEqualToString:tabTrigger]) {
- [result addObject:fav];
- }
- }
-
-#ifndef SP_CODA
- if (includeGlobals && [prefs objectForKey:SPQueryFavorites]) {
-
- for (id fav in [prefs objectForKey:SPQueryFavorites])
- {
- if ([fav objectForKey:@"tabtrigger"] && [[fav objectForKey:@"tabtrigger"] isEqualToString:tabTrigger]) {
- [result addObject:fav];
- break;
- }
- }
- }
-#endif
-
- return [result autorelease];
-}
-
-#pragma mark -
-#pragma mark Completion list controller
-
-/**
- * Return an array of all pre-defined SQL functions for completion.
- */
-- (NSArray*)functionList
-{
- return (completionFunctionList != nil && [completionFunctionList count]) ? completionFunctionList : @[];
-}
-
-/**
- * Return an array of all pre-defined SQL keywords for completion.
- */
-- (NSArray*)keywordList
-{
- return (completionKeywordList != nil && [completionKeywordList count]) ? completionKeywordList : @[];
-}
-
-/**
- * Return the parameter list as snippet of the passed SQL functions for completion.
- *
- * @param func The name of the function whose parameter list is asked for
- */
-- (NSString*)argumentSnippetForFunction:(NSString*)func
-{
- return (functionArgumentSnippets && [functionArgumentSnippets objectForKey:[func uppercaseString]]) ? [functionArgumentSnippets objectForKey:[func uppercaseString]] : @"";
-}
-
-@end
diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m
index 36e5dd26..e987986b 100644
--- a/Source/SPQueryFavoriteManager.m
+++ b/Source/SPQueryFavoriteManager.m
@@ -32,7 +32,6 @@
#import "ImageAndTextCell.h"
#import "SPEncodingPopupAccessory.h"
#import "SPQueryController.h"
-#import "SPQueryDocumentsController.h"
#import "SPDatabaseDocument.h"
#import "SPConnectionController.h"
#import "RegexKitLite.h"
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m
index 87e996c7..aa614b76 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -39,7 +39,6 @@
#import "SPDataCellFormatter.h"
#import "SPTableData.h"
#import "SPQueryController.h"
-#import "SPQueryDocumentsController.h"
#import "SPTextAndLinkCell.h"
#ifndef SP_CODA
#import "SPSplitView.h"
diff --git a/Source/SPTextView.m b/Source/SPTextView.m
index 7056befd..f06bbaef 100644
--- a/Source/SPTextView.m
+++ b/Source/SPTextView.m
@@ -33,7 +33,6 @@
#import "SPDatabaseDocument.h"
#import "SPNarrowDownCompletion.h"
#import "SPQueryController.h"
-#import "SPQueryDocumentsController.h"
#import "SPTooltip.h"
#import "SPTablesList.h"
#import "SPNavigatorController.h"
diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj
index cbbc528a..9f8f46b2 100644
--- a/sequel-pro.xcodeproj/project.pbxproj
+++ b/sequel-pro.xcodeproj/project.pbxproj
@@ -28,8 +28,6 @@
11B55BFE1189E3B2009EF465 /* SPDatabaseAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 11B55BFD1189E3B2009EF465 /* SPDatabaseAction.m */; };
11C211301180EC9A00758039 /* SPDatabaseRename.m in Sources */ = {isa = PBXBuildFile; fileRef = 11C2109D1180E70800758039 /* SPDatabaseRename.m */; };
171312CE109D23C700FB465F /* SPTableTextFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 171312CD109D23C700FB465F /* SPTableTextFieldCell.m */; };
- 1713C740140D8AEF00CFD461 /* SPQueryDocumentsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1713C73F140D8AEF00CFD461 /* SPQueryDocumentsController.m */; };
- 1713C75F140D8D5900CFD461 /* SPQueryConsoleDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 1713C75E140D8D5900CFD461 /* SPQueryConsoleDataSource.m */; };
17148565125F5FF500321285 /* SPDatabaseCharacterSets.m in Sources */ = {isa = PBXBuildFile; fileRef = 17148564125F5FF500321285 /* SPDatabaseCharacterSets.m */; };
1717F9661557E0450065C036 /* SPStringAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 1789343B0F30C1DD0097539A /* SPStringAdditions.m */; };
1717F9DB1558114D0065C036 /* OCMock.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 11D44DEF118F5887002AA43C /* OCMock.framework */; };
@@ -72,7 +70,6 @@
1785EB66127DD5EA00F468C8 /* SPNetworkPreferencePane.m in Sources */ = {isa = PBXBuildFile; fileRef = 1785EB65127DD5EA00F468C8 /* SPNetworkPreferencePane.m */; };
1785EB6A127DD79300F468C8 /* SPEditorPreferencePane.m in Sources */ = {isa = PBXBuildFile; fileRef = 1785EB69127DD79300F468C8 /* SPEditorPreferencePane.m */; };
1789343C0F30C1DD0097539A /* SPStringAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 1789343B0F30C1DD0097539A /* SPStringAdditions.m */; };
- 17902612141025BB005F677F /* SPQueryControllerInitializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 17902611141025BB005F677F /* SPQueryControllerInitializer.m */; };
1792C13210AD752100ABE758 /* DatabaseServerVariables.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1792C13010AD752100ABE758 /* DatabaseServerVariables.xib */; };
1792C13710AD75C800ABE758 /* SPServerVariablesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1792C13610AD75C800ABE758 /* SPServerVariablesController.m */; };
1798F1871550175B004B0AB8 /* SPFavoritesExporter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1798F1821550175B004B0AB8 /* SPFavoritesExporter.m */; };
@@ -655,10 +652,6 @@
1713122F109C7DF600FB465F /* build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = build.sh; sourceTree = "<group>"; };
171312CC109D23C700FB465F /* SPTableTextFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPTableTextFieldCell.h; sourceTree = "<group>"; };
171312CD109D23C700FB465F /* SPTableTextFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableTextFieldCell.m; sourceTree = "<group>"; };
- 1713C73E140D8AEF00CFD461 /* SPQueryDocumentsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPQueryDocumentsController.h; sourceTree = "<group>"; };
- 1713C73F140D8AEF00CFD461 /* SPQueryDocumentsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPQueryDocumentsController.m; sourceTree = "<group>"; };
- 1713C75D140D8D5900CFD461 /* SPQueryConsoleDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPQueryConsoleDataSource.h; sourceTree = "<group>"; };
- 1713C75E140D8D5900CFD461 /* SPQueryConsoleDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPQueryConsoleDataSource.m; sourceTree = "<group>"; };
17148563125F5FF500321285 /* SPDatabaseCharacterSets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDatabaseCharacterSets.h; sourceTree = "<group>"; };
17148564125F5FF500321285 /* SPDatabaseCharacterSets.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDatabaseCharacterSets.m; sourceTree = "<group>"; };
171C398D16BD634600209EC6 /* SPDatabaseContentViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDatabaseContentViewDelegate.h; sourceTree = "<group>"; };
@@ -740,8 +733,6 @@
1789343A0F30C1DD0097539A /* SPStringAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPStringAdditions.h; sourceTree = "<group>"; };
1789343B0F30C1DD0097539A /* SPStringAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPStringAdditions.m; sourceTree = "<group>"; };
178934980F30CDA10097539A /* trim-application.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "trim-application.sh"; sourceTree = "<group>"; };
- 17902610141025BB005F677F /* SPQueryControllerInitializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPQueryControllerInitializer.h; sourceTree = "<group>"; };
- 17902611141025BB005F677F /* SPQueryControllerInitializer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPQueryControllerInitializer.m; sourceTree = "<group>"; };
1792C13110AD752100ABE758 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Interfaces/English.lproj/DatabaseServerVariables.xib; sourceTree = "<group>"; };
1792C13510AD75C800ABE758 /* SPServerVariablesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPServerVariablesController.h; sourceTree = "<group>"; };
1792C13610AD75C800ABE758 /* SPServerVariablesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPServerVariablesController.m; sourceTree = "<group>"; };
@@ -1477,12 +1468,6 @@
children = (
BC29C37D10501EFD00DD6C6E /* SPQueryController.h */,
BC29C37E10501EFD00DD6C6E /* SPQueryController.m */,
- 17902610141025BB005F677F /* SPQueryControllerInitializer.h */,
- 17902611141025BB005F677F /* SPQueryControllerInitializer.m */,
- 1713C75D140D8D5900CFD461 /* SPQueryConsoleDataSource.h */,
- 1713C75E140D8D5900CFD461 /* SPQueryConsoleDataSource.m */,
- 1713C73E140D8AEF00CFD461 /* SPQueryDocumentsController.h */,
- 1713C73F140D8AEF00CFD461 /* SPQueryDocumentsController.m */,
);
name = "Query Controller";
sourceTree = "<group>";
@@ -3362,10 +3347,7 @@
BC0ED3DA12A9196C00088461 /* SPChooseMenuItemDialog.m in Sources */,
583CA21512EC8B2200C9E763 /* SPWindow.m in Sources */,
582F02311370B52600B30621 /* SPExportFileNameTokenObject.m in Sources */,
- 1713C740140D8AEF00CFD461 /* SPQueryDocumentsController.m in Sources */,
500DA4BC1BF0CD57000773FE /* SPScreenAdditions.m in Sources */,
- 1713C75F140D8D5900CFD461 /* SPQueryConsoleDataSource.m in Sources */,
- 17902612141025BB005F677F /* SPQueryControllerInitializer.m in Sources */,
584D878B15140FEB00F24774 /* SPObjectAdditions.m in Sources */,
584D87921514101E00F24774 /* SPDatabaseStructure.m in Sources */,
584D88A91515034200F24774 /* NSNotificationCenterThreadingAdditions.m in Sources */,