diff options
author | Bibiko <bibiko@eva.mpg.de> | 2009-05-19 18:13:43 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2009-05-19 18:13:43 +0000 |
commit | 391e0a1421134f350c9dd27a6c37f46830d8a010 (patch) | |
tree | f352fb3a139dbfd3cbb3a79e83146e59f0937ab8 /Source | |
parent | 1043c60fb5f69a25ca429051f90e53489feab715 (diff) | |
download | sequelpro-391e0a1421134f350c9dd27a6c37f46830d8a010.tar.gz sequelpro-391e0a1421134f350c9dd27a6c37f46830d8a010.tar.bz2 sequelpro-391e0a1421134f350c9dd27a6c37f46830d8a010.zip |
• fixed some issues for drag&drop a file to the CustomQuery editor
- close sheet before inserting
- ensure that a file with the extension "sql" will be inserted (UNIX "file" could detect a file as being a non plain text file)
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMTextView.m | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/CMTextView.m b/Source/CMTextView.m index 9a25dfd8..366adf16 100644 --- a/Source/CMTextView.m +++ b/Source/CMTextView.m @@ -2169,6 +2169,7 @@ YY_BUFFER_STATE yy_scan_string (const char *); - (void)dragAlertSheetDidEnd:(NSAlert *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { + [[sheet window] orderOut:nil]; if ( returnCode == NSAlertFirstButtonReturn ) [self insertFileContentOfFile:[sheet helpAnchor]]; @@ -2226,7 +2227,7 @@ YY_BUFFER_STATE yy_scan_string (const char *); [task release]; // UTF16/32 files are detected as application/octet-stream resp. audio/mpeg - if([result hasPrefix:@"application/octet-stream"] || [result hasPrefix:@"audio/mpeg"] || [result hasPrefix:@"text/plain"]) + if([result hasPrefix:@"application/octet-stream"] || [result hasPrefix:@"audio/mpeg"] || [result hasPrefix:@"text/plain"] || [[[aPath pathExtension] lowercaseString] isEqualToString:@"sql"]) { // if UTF16/32 cocoa will try to find the correct encoding if([result hasPrefix:@"application/octet-stream"] || [result hasPrefix:@"audio/mpeg"] || [result rangeOfString:@"utf-16"].length) |