diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-12-21 11:23:55 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-12-21 11:23:55 +0000 |
commit | 4c0b75237fd608107cfff54e904f1b424564617e (patch) | |
tree | 468e13cc971a78572228bed87dd62a67af2bfc56 /Source | |
parent | c486a4033c121a5e836600857a7db3977b94d160 (diff) | |
download | sequelpro-4c0b75237fd608107cfff54e904f1b424564617e.tar.gz sequelpro-4c0b75237fd608107cfff54e904f1b424564617e.tar.bz2 sequelpro-4c0b75237fd608107cfff54e904f1b424564617e.zip |
• fixed issue form redirecting output actions via exit codes if Bundle's default output action was None
• renamed constants to avoid confusing
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPAppController.m | 7 | ||||
-rw-r--r-- | Source/SPBundleEditorController.m | 6 | ||||
-rw-r--r-- | Source/SPConstants.h | 6 | ||||
-rw-r--r-- | Source/SPConstants.m | 6 | ||||
-rw-r--r-- | Source/SPCopyTable.m | 7 | ||||
-rw-r--r-- | Source/SPStringAdditions.m | 6 | ||||
-rw-r--r-- | Source/SPTextViewAdditions.m | 7 |
7 files changed, 24 insertions, 21 deletions
diff --git a/Source/SPAppController.m b/Source/SPAppController.m index a974ebf1..cbadfb85 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -825,7 +825,9 @@ [[NSFileManager defaultManager] removeItemAtPath:bundleInputFilePath error:nil]; - NSString *action = [[cmdData objectForKey:SPBundleFileOutputActionKey] lowercaseString]; + NSString *action = SPBundleOutputActionNone; + if([cmdData objectForKey:SPBundleFileOutputActionKey] && [[cmdData objectForKey:SPBundleFileOutputActionKey] length]) + action = [[cmdData objectForKey:SPBundleFileOutputActionKey] lowercaseString]; // Redirect due exit code if(err != nil) { @@ -864,8 +866,7 @@ } if(err == nil && output) { - if([cmdData objectForKey:SPBundleFileOutputActionKey] && [[cmdData objectForKey:SPBundleFileOutputActionKey] length] - && ![[cmdData objectForKey:SPBundleFileOutputActionKey] isEqualToString:SPBundleOutputActionNone]) { + if(![action isEqualToString:SPBundleOutputActionNone]) { NSPoint pos = [NSEvent mouseLocation]; pos.y -= 16; diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index 3d64c112..785618d2 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -316,9 +316,9 @@ SPBundleShellVariableExitNone, SPBundleShellVariableExitReplaceContent, SPBundleShellVariableExitReplaceSelection, - SPBundleShellVariableExitInsertAsHTML, - SPBundleShellVariableExitInsertAsHTMLTooltip, - SPBundleShellVariableExitInsertAsTextTooltip, + SPBundleShellVariableExitShowAsHTML, + SPBundleShellVariableExitShowAsHTMLTooltip, + SPBundleShellVariableExitShowAsTextTooltip, SPBundleShellVariableInputFilePath, SPBundleShellVariableInputTableMetaData, SPBundleShellVariableBundlePath, diff --git a/Source/SPConstants.h b/Source/SPConstants.h index 37687ba1..92aa0786 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -527,9 +527,9 @@ extern NSString *SPBundleShellVariableExitReplaceSelection; extern NSString *SPBundleShellVariableExitReplaceContent; extern NSString *SPBundleShellVariableExitInsertAsText; extern NSString *SPBundleShellVariableExitInsertAsSnippet; -extern NSString *SPBundleShellVariableExitInsertAsHTML; -extern NSString *SPBundleShellVariableExitInsertAsTextTooltip; -extern NSString *SPBundleShellVariableExitInsertAsHTMLTooltip; +extern NSString *SPBundleShellVariableExitShowAsHTML; +extern NSString *SPBundleShellVariableExitShowAsTextTooltip; +extern NSString *SPBundleShellVariableExitShowAsHTMLTooltip; extern NSString *SPBundleShellVariableCurrentHost; extern NSString *SPBundleShellVariableCurrentUser; extern NSString *SPBundleShellVariableCurrentPort; diff --git a/Source/SPConstants.m b/Source/SPConstants.m index d2edebfa..4d7c8850 100644 --- a/Source/SPConstants.m +++ b/Source/SPConstants.m @@ -326,11 +326,11 @@ NSString *SPBundleShellVariableCurrentUser = @"SP_CURRENT_USER" NSString *SPBundleShellVariableCurrentWord = @"SP_CURRENT_WORD"; NSString *SPBundleShellVariableDatabaseEncoding = @"SP_DATABASE_ENCODING"; NSString *SPBundleShellVariableDataTableSource = @"SP_DATA_TABLE_SOURCE"; -NSString *SPBundleShellVariableExitInsertAsHTML = @"SP_BUNDLE_EXIT_SHOW_AS_HTML"; -NSString *SPBundleShellVariableExitInsertAsHTMLTooltip = @"SP_BUNDLE_EXIT_SHOW_AS_HTML_TOOLTIP"; +NSString *SPBundleShellVariableExitShowAsHTML = @"SP_BUNDLE_EXIT_SHOW_AS_HTML"; +NSString *SPBundleShellVariableExitShowAsHTMLTooltip = @"SP_BUNDLE_EXIT_SHOW_AS_HTML_TOOLTIP"; NSString *SPBundleShellVariableExitInsertAsSnippet = @"SP_BUNDLE_EXIT_INSERT_AS_SNIPPET"; NSString *SPBundleShellVariableExitInsertAsText = @"SP_BUNDLE_EXIT_INSERT_AS_TEXT"; -NSString *SPBundleShellVariableExitInsertAsTextTooltip = @"SP_BUNDLE_EXIT_SHOW_AS_TEXT_TOOLTIP"; +NSString *SPBundleShellVariableExitShowAsTextTooltip = @"SP_BUNDLE_EXIT_SHOW_AS_TEXT_TOOLTIP"; NSString *SPBundleShellVariableExitNone = @"SP_BUNDLE_EXIT_NONE"; NSString *SPBundleShellVariableExitReplaceContent = @"SP_BUNDLE_EXIT_REPLACE_CONTENT"; NSString *SPBundleShellVariableExitReplaceSelection = @"SP_BUNDLE_EXIT_REPLACE_SELECTION"; diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index fad9332e..827672b5 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -1276,7 +1276,9 @@ NSInteger kBlobAsImageFile = 4; [[NSFileManager defaultManager] removeItemAtPath:bundleInputFilePath error:nil]; - NSString *action = [[cmdData objectForKey:SPBundleFileOutputActionKey] lowercaseString]; + NSString *action = SPBundleOutputActionNone; + if([cmdData objectForKey:SPBundleFileOutputActionKey] && [[cmdData objectForKey:SPBundleFileOutputActionKey] length]) + action = [[cmdData objectForKey:SPBundleFileOutputActionKey] lowercaseString]; // Redirect due exit code if(err != nil) { @@ -1315,8 +1317,7 @@ NSInteger kBlobAsImageFile = 4; } if(err == nil && output) { - if([cmdData objectForKey:SPBundleFileOutputActionKey] && [[cmdData objectForKey:SPBundleFileOutputActionKey] length] - && ![[cmdData objectForKey:SPBundleFileOutputActionKey] isEqualToString:SPBundleOutputActionNone]) { + if(![action isEqualToString:SPBundleOutputActionNone]) { NSPoint pos = [NSEvent mouseLocation]; pos.y -= 16; diff --git a/Source/SPStringAdditions.m b/Source/SPStringAdditions.m index b523907c..a8346399 100644 --- a/Source/SPStringAdditions.m +++ b/Source/SPStringAdditions.m @@ -526,9 +526,9 @@ [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionReplaceContent] forKey:SPBundleShellVariableExitReplaceContent]; [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionInsertAsText] forKey:SPBundleShellVariableExitInsertAsText]; [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionInsertAsSnippet] forKey:SPBundleShellVariableExitInsertAsSnippet]; - [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionShowAsHTML] forKey:SPBundleShellVariableExitInsertAsHTML]; - [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionShowAsTextTooltip] forKey:SPBundleShellVariableExitInsertAsTextTooltip]; - [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionShowAsHTMLTooltip] forKey:SPBundleShellVariableExitInsertAsHTMLTooltip]; + [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionShowAsHTML] forKey:SPBundleShellVariableExitShowAsHTML]; + [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionShowAsTextTooltip] forKey:SPBundleShellVariableExitShowAsTextTooltip]; + [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionShowAsHTMLTooltip] forKey:SPBundleShellVariableExitShowAsHTMLTooltip]; // Create and set an unique process ID for each SPDatabaseDocument which has to passed // for each sequelpro:// scheme command as user to be able to identify the url scheme command. diff --git a/Source/SPTextViewAdditions.m b/Source/SPTextViewAdditions.m index f04c6684..2e1f8f9b 100644 --- a/Source/SPTextViewAdditions.m +++ b/Source/SPTextViewAdditions.m @@ -649,7 +649,9 @@ [[NSFileManager defaultManager] removeItemAtPath:bundleInputFilePath error:nil]; - NSString *action = [[cmdData objectForKey:SPBundleFileOutputActionKey] lowercaseString]; + NSString *action = SPBundleOutputActionNone; + if([cmdData objectForKey:SPBundleFileOutputActionKey] && [[cmdData objectForKey:SPBundleFileOutputActionKey] length]) + action = [[cmdData objectForKey:SPBundleFileOutputActionKey] lowercaseString]; // Redirect due exit code if(err != nil) { @@ -688,8 +690,7 @@ } if(err == nil && output) { - if([cmdData objectForKey:SPBundleFileOutputActionKey] && [[cmdData objectForKey:SPBundleFileOutputActionKey] length] - && ![[cmdData objectForKey:SPBundleFileOutputActionKey] isEqualToString:SPBundleOutputActionNone]) { + if(![action isEqualToString:SPBundleOutputActionNone]) { if([action isEqualToString:SPBundleOutputActionShowAsTextTooltip]) { [SPTooltip showWithObject:output]; |