Revision: 7796
http://skim-app.svn.sourceforge.net/skim-app/?rev=7796&view=rev
Author: hofman
Date: 2012-11-06 15:22:54 +0000 (Tue, 06 Nov 2012)
Log Message:
-----------
use UTIs for notes open panel
Modified Paths:
--------------
trunk/SKMainDocument.m
Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m 2012-11-06 13:09:09 UTC (rev 7795)
+++ trunk/SKMainDocument.m 2012-11-06 15:22:54 UTC (rev 7796)
@@ -959,12 +959,13 @@
#pragma mark Actions
- (void)readNotesFromURL:(NSURL *)notesURL replace:(BOOL)replace
{log_method();return;
- NSString *extension = [notesURL pathExtension];
+ NSWorkspace *ws = [NSWorkspace sharedWorkspace];
+ NSString *type = [ws typeOfFile:[notesURL path] error:NULL];
NSArray *array = nil;
- if ([extension isCaseInsensitiveEqual:@"skim"]) {
+ if ([ws type:type conformsToType:SKNotesDocumentType]) {
array = [NSKeyedUnarchiver unarchiveObjectWithFile:[notesURL path]];
- } else {
+ } else if ([ws type:type conformsToType:SKNotesFDFDocumentType]) {
NSData *fdfData = [NSData dataWithContentsOfURL:notesURL];
if (fdfData)
array = [SKFDFParser noteDictionariesFromFDFData:fdfData];
@@ -997,7 +998,7 @@
[oPanel setDirectoryURL:[fileURL URLByDeletingLastPathComponent]];
[oPanel setNameFieldStringValue:[fileURL lastPathComponent]];
- [oPanel setAllowedFileTypes:[NSArray arrayWithObjects:@"skim", nil]];
+ [oPanel setAllowedFileTypes:[NSArray arrayWithObjects:SKNotesDocumentType,
nil]];
[oPanel beginSheetModalForWindow:[self windowForSheet]
completionHandler:^(NSInteger result){
if (result == NSFileHandlingPanelOKButton) {
NSURL *notesURL = [[oPanel URLs] objectAtIndex:0];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit