From 391e0a1421134f350c9dd27a6c37f46830d8a010 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Tue, 19 May 2009 18:13:43 +0000 Subject: =?UTF-8?q?=E2=80=A2=20fixed=20some=20issues=20for=20drag&drop=20a?= =?UTF-8?q?=20file=20to=20the=20CustomQuery=20editor=20-=20close=20sheet?= =?UTF-8?q?=20before=20inserting=20-=20ensure=20that=20a=20file=20with=20t?= =?UTF-8?q?he=20extension=20"sql"=20will=20be=20inserted=20(UNIX=20"file"?= =?UTF-8?q?=20could=20detect=20a=20file=20as=20being=20a=20non=20plain=20t?= =?UTF-8?q?ext=20file)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/CMTextView.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Source') 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) -- cgit v1.2.3