Revision: 4270
http://skim-app.svn.sourceforge.net/skim-app/?rev=4270&view=rev
Author: hofman
Date: 2008-07-21 16:57:53 +0000 (Mon, 21 Jul 2008)
Log Message:
-----------
Code layout and return error for unknown verb
Modified Paths:
--------------
trunk/SkimNotes/skimnotes.m
Modified: trunk/SkimNotes/skimnotes.m
===================================================================
--- trunk/SkimNotes/skimnotes.m 2008-07-21 16:47:19 UTC (rev 4269)
+++ trunk/SkimNotes/skimnotes.m 2008-07-21 16:57:53 UTC (rev 4270)
@@ -106,8 +106,14 @@
BOOL success = NO;
- if (action == SKNActionAgent) {
+ if (action == SKNActionUnknown) {
+ WRITE_ERROR;
+ [pool release];
+ exit(EXIT_FAILURE);
+
+ } else if (action == SKNActionAgent) {
+
NSString *serverName = [args count] > 2 ? [args lastObject] : nil;
SKNAgentListener *listener = [[SKNAgentListener alloc]
initWithServerName:serverName];
@@ -216,8 +222,11 @@
}
if ([fm fileExistsAtPath:pdfPath isDirectory:&isDir] == NO || isBundle
!= isDir) {
+
error = [NSError errorWithDomain:NSPOSIXErrorDomain code:ENOENT
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:isBundle ? @"PDF bundle
does not exist" : @"PDF file does not exist", NSLocalizedDescriptionKey, nil]];
+
} else if (action == SKNActionGet) {
+
NSData *data = nil;
if (format == SKNFormatAuto) {
NSString *extension = [notesPath pathExtension];
@@ -251,7 +260,9 @@
}
}
}
+
} else if (action == SKNActionSet) {
+
if (notesPath && ([notesPath isEqualToString:STD_IN_OUT_FILE] ||
([fm fileExistsAtPath:notesPath isDirectory:&isDir] && isDir == NO))) {
NSData *data = nil;
NSString *textString = nil;
@@ -279,9 +290,13 @@
} else {
error = [NSError errorWithDomain:NSPOSIXErrorDomain
code:ENOENT userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Notes file
does not exist", NSLocalizedDescriptionKey, nil]];
}
+
} else if (action == SKNActionRemove) {
+
success = [fm removeSkimNotesAtPath:pdfPath error:&error];
+
} else if (action == SKNActionConvert) {
+
if (isBundle) {
success = [fm createDirectoryAtPath:notesPath attributes:nil];
} else {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit