aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CustomQuery.m4
-rw-r--r--Source/SPConstants.h7
-rw-r--r--Source/TableDocument.h7
-rw-r--r--Source/TableDocument.m8
-rw-r--r--Source/TableDump.m26
5 files changed, 26 insertions, 26 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index 2a1492af..14b8c191 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -398,7 +398,7 @@
// BOOL queriesSeparatedByDelimiter = NO;
NSCharacterSet *whitespaceAndNewlineSet = [NSCharacterSet whitespaceAndNewlineCharacterSet];
- [tableDocumentInstance setQueryMode:SP_QUERYMODE_CUSTOMQUERY];
+ [tableDocumentInstance setQueryMode:SPCustomQueryQueryMode];
// Notify listeners that a query has started
[[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryWillBePerformed" object:tableDocumentInstance];
@@ -692,7 +692,7 @@
// Restore automatic query retries
[mySQLConnection setAllowQueryRetries:YES];
- [tableDocumentInstance setQueryMode:SP_QUERYMODE_INTERFACE];
+ [tableDocumentInstance setQueryMode:SPInterfaceQueryMode];
// If no results were returned, redraw the empty table and post notifications before returning.
if ( !fullResultCount ) {
diff --git a/Source/SPConstants.h b/Source/SPConstants.h
index e42b11b7..fa5e0e85 100644
--- a/Source/SPConstants.h
+++ b/Source/SPConstants.h
@@ -67,6 +67,13 @@ typedef enum {
SPQueryEditorViewMode = 5
} SPViewMode;
+// Query modes
+typedef enum {
+ SPInterfaceQueryMode = 0,
+ SPCustomQueryQueryMode = 1,
+ SPImportExportQueryMode = 2
+} SPQueryMode;
+
// Kill mode constants
extern NSString *SPKillProcessQueryMode;
extern NSString *SPKillProcessConnectionMode;
diff --git a/Source/TableDocument.h b/Source/TableDocument.h
index a577a6c4..2aae4da5 100644
--- a/Source/TableDocument.h
+++ b/Source/TableDocument.h
@@ -31,13 +31,6 @@
@class SPConnectionController, SPProcessListController, SPServerVariablesController, SPUserManager;
-enum sp_current_query_mode
-{
- SP_QUERYMODE_INTERFACE = 0,
- SP_QUERYMODE_CUSTOMQUERY = 1,
- SP_QUERYMODE_IMPORTEXPORT = 2
-};
-
/**
* The TableDocument class controls the primary database view window.
*/
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 6e3c91ca..65c8afd6 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -77,7 +77,7 @@
_isConnected = NO;
_isWorkingLevel = 0;
databaseListIsSelectable = YES;
- _queryMode = SP_QUERYMODE_INTERFACE;
+ _queryMode = SPInterfaceQueryMode;
chooseDatabaseButton = nil;
chooseDatabaseToolbarItem = nil;
connectionController = nil;
@@ -3435,9 +3435,9 @@
- (void)willQueryString:(NSString *)query connection:(id)connection
{
if ([prefs boolForKey:SPConsoleEnableLogging]) {
- if ((_queryMode == SP_QUERYMODE_INTERFACE && [prefs boolForKey:SPConsoleEnableInterfaceLogging])
- || (_queryMode == SP_QUERYMODE_CUSTOMQUERY && [prefs boolForKey:SPConsoleEnableCustomQueryLogging])
- || (_queryMode == SP_QUERYMODE_IMPORTEXPORT && [prefs boolForKey:SPConsoleEnableImportExportLogging]))
+ if ((_queryMode == SPInterfaceQueryMode && [prefs boolForKey:SPConsoleEnableInterfaceLogging])
+ || (_queryMode == SPCustomQueryQueryMode && [prefs boolForKey:SPConsoleEnableCustomQueryLogging])
+ || (_queryMode == SPImportExportQueryMode && [prefs boolForKey:SPConsoleEnableImportExportLogging]))
{
[[SPQueryController sharedQueryController] showMessageInConsole:query];
}
diff --git a/Source/TableDump.m b/Source/TableDump.m
index 21379c90..02e46cd7 100644
--- a/Source/TableDump.m
+++ b/Source/TableDump.m
@@ -554,7 +554,7 @@
[NSApp beginSheet:singleProgressSheet modalForWindow:tableWindow modalDelegate:self didEndSelector:nil contextInfo:nil];
[singleProgressSheet makeKeyWindow];
- [tableDocumentInstance setQueryMode:SP_QUERYMODE_IMPORTEXPORT];
+ [tableDocumentInstance setQueryMode:SPImportExportQueryMode];
// Read in the file in a loop
sqlParser = [[SPSQLParser alloc] init];
@@ -577,7 +577,7 @@
[sqlParser release];
[sqlDataBuffer release];
[importPool drain];
- [tableDocumentInstance setQueryMode:SP_QUERYMODE_INTERFACE];
+ [tableDocumentInstance setQueryMode:SPInterfaceQueryMode];
return;
}
@@ -625,7 +625,7 @@
[sqlParser release];
[sqlDataBuffer release];
[importPool drain];
- [tableDocumentInstance setQueryMode:SP_QUERYMODE_INTERFACE];
+ [tableDocumentInstance setQueryMode:SPInterfaceQueryMode];
return;
}
}
@@ -704,7 +704,7 @@
[sqlParser release];
[sqlDataBuffer release];
[importPool drain];
- [tableDocumentInstance setQueryMode:SP_QUERYMODE_INTERFACE];
+ [tableDocumentInstance setQueryMode:SPInterfaceQueryMode];
// Close progress sheet
[self closeAndStopProgressSheet];
@@ -791,7 +791,7 @@
[NSApp beginSheet:singleProgressSheet modalForWindow:tableWindow modalDelegate:self didEndSelector:nil contextInfo:nil];
[singleProgressSheet makeKeyWindow];
- [tableDocumentInstance setQueryMode:SP_QUERYMODE_IMPORTEXPORT];
+ [tableDocumentInstance setQueryMode:SPImportExportQueryMode];
// Read in the file in a loop. The loop actually needs to perform three tasks: read in
// CSV data and parse them into row arrays; present the field mapping interface once it
@@ -835,7 +835,7 @@
[parsedRows release];
[parsePositions release];
[importPool drain];
- [tableDocumentInstance setQueryMode:SP_QUERYMODE_INTERFACE];
+ [tableDocumentInstance setQueryMode:SPInterfaceQueryMode];
return;
}
@@ -875,7 +875,7 @@
[parsedRows release];
[parsePositions release];
[importPool drain];
- [tableDocumentInstance setQueryMode:SP_QUERYMODE_INTERFACE];
+ [tableDocumentInstance setQueryMode:SPInterfaceQueryMode];
return;
}
@@ -919,7 +919,7 @@
[parsedRows release];
[parsePositions release];
[importPool drain];
- [tableDocumentInstance setQueryMode:SP_QUERYMODE_INTERFACE];
+ [tableDocumentInstance setQueryMode:SPInterfaceQueryMode];
return;
}
@@ -1016,7 +1016,7 @@
[parsePositions release];
if (fieldMappingArray) [fieldMappingArray release], fieldMappingArray = nil;
[importPool drain];
- [tableDocumentInstance setQueryMode:SP_QUERYMODE_INTERFACE];
+ [tableDocumentInstance setQueryMode:SPInterfaceQueryMode];
// Close progress sheet
[self closeAndStopProgressSheet];
@@ -1311,7 +1311,7 @@
modalForWindow:tableWindow modalDelegate:self
didEndSelector:nil contextInfo:nil];
- [tableDocumentInstance setQueryMode:SP_QUERYMODE_IMPORTEXPORT];
+ [tableDocumentInstance setQueryMode:SPImportExportQueryMode];
// Copy over the selected table names into a table in preparation for iteration
for ( i = 0 ; i < [tables count] ; i++ ) {
@@ -1608,7 +1608,7 @@
[errorsSheet orderOut:nil];
}
- [tableDocumentInstance setQueryMode:SP_QUERYMODE_INTERFACE];
+ [tableDocumentInstance setQueryMode:SPInterfaceQueryMode];
[sqlString release];
return TRUE;
@@ -2223,7 +2223,7 @@
[singleProgressBar setDoubleValue:0];
[singleProgressBar displayIfNeeded];
- [tableDocumentInstance setQueryMode:SP_QUERYMODE_IMPORTEXPORT];
+ [tableDocumentInstance setQueryMode:SPImportExportQueryMode];
// Open the progress sheet
[NSApp beginSheet:singleProgressSheet
@@ -2401,7 +2401,7 @@
[errorsSheet orderOut:nil];
}
- [tableDocumentInstance setQueryMode:SP_QUERYMODE_INTERFACE];
+ [tableDocumentInstance setQueryMode:SPInterfaceQueryMode];
return TRUE;
}