diff options
Diffstat (limited to 'Source/SPAppController.m')
-rw-r--r-- | Source/SPAppController.m | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/SPAppController.m b/Source/SPAppController.m index 9737630e..1575e235 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -279,15 +279,15 @@ YY_BUFFER_STATE yy_scan_string (const char *); */ - (void)application:(NSApplication *)app openFiles:(NSArray *)filenames { - for (NSString *filename in filenames) { // Opens a sql file and insert its content into the Custom Query editor - if([[[filename pathExtension] lowercaseString] isEqualToString:[SPFileExtensionSQL lowercaseString]]) { + if ([[[filename pathExtension] lowercaseString] isEqualToString:[SPFileExtensionSQL lowercaseString]]) { // Check size and NSFileType - NSDictionary *attr = [[NSFileManager defaultManager] fileAttributesAtPath:filename traverseLink:YES]; - if(attr) + NSDictionary *attr = [[NSFileManager defaultManager] attributesOfItemAtPath:filename error:nil]; + + if (attr) { NSNumber *filesize = [attr objectForKey:NSFileSize]; NSString *filetype = [attr objectForKey:NSFileType]; |