Revision: 5742
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5742&view=rev
Author:   hofman
Date:     2009-09-10 23:17:44 +0000 (Thu, 10 Sep 2009)

Log Message:
-----------
Set deployment target for 10.6 SDK to 10.5. Use newer NSFileManager method when 
the deployment target allows it. Conditionally declare the agent listener to 
conform to the connection delegate.

Modified Paths:
--------------
    trunk/SkimNotes/Configurations/SkimNotes-Common.xcconfig
    trunk/SkimNotes/NSFileManager_SKNToolExtensions.m
    trunk/SkimNotes/SKNAgentListener.h
    trunk/SkimNotes/SkimNotes.xcodeproj/project.pbxproj
    trunk/SkimNotes/skimnotes.m

Modified: trunk/SkimNotes/Configurations/SkimNotes-Common.xcconfig
===================================================================
--- trunk/SkimNotes/Configurations/SkimNotes-Common.xcconfig    2009-09-10 
22:25:40 UTC (rev 5741)
+++ trunk/SkimNotes/Configurations/SkimNotes-Common.xcconfig    2009-09-10 
23:17:44 UTC (rev 5742)
@@ -7,6 +7,7 @@
 MACOSX_DEPLOYMENT_TARGET[arch=i386] = 10.4
 MACOSX_DEPLOYMENT_TARGET[arch=ppc64] = 10.5
 MACOSX_DEPLOYMENT_TARGET[arch=x86_64] = 10.5
+MACOSX_DEPLOYMENT_TARGET[sdk=macosx10.6] = 10.5
 
 COPY_PHASE_STRIP = YES
 STRIP_INSTALLED_PRODUCT = YES

Modified: trunk/SkimNotes/NSFileManager_SKNToolExtensions.m
===================================================================
--- trunk/SkimNotes/NSFileManager_SKNToolExtensions.m   2009-09-10 22:25:40 UTC 
(rev 5741)
+++ trunk/SkimNotes/NSFileManager_SKNToolExtensions.m   2009-09-10 23:17:44 UTC 
(rev 5742)
@@ -198,7 +198,17 @@
     
     if ([extension caseInsensitiveCompare:PDFD_EXTENSION] == NSOrderedSame) {
         NSString *notePath;
+#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4
         if (notePath = [self notesFileWithExtension:SKIM_EXTENSION atPath:path 
error:NULL])
+            success1 = [self removeItemAtPath:notePath error:NULL];
+        if (notePath = [self notesFileWithExtension:TXT_EXTENSION atPath:path 
error:NULL])
+            success2 = [self removeItemAtPath:notePath error:NULL];
+        if (notePath = [self notesFileWithExtension:RTF_EXTENSION atPath:path 
error:NULL])
+            success3 = [self removeItemAtPath:notePath error:NULL];
+        if (notePath = [self notesFileWithExtension:FDF_EXTENSION atPath:path 
error:NULL])
+            [self removeItemAtPath:notePath error:NULL];
+#else
+        if (notePath = [self notesFileWithExtension:SKIM_EXTENSION atPath:path 
error:NULL])
             success1 = [self removeFileAtPath:notePath handler:nil];
         if (notePath = [self notesFileWithExtension:TXT_EXTENSION atPath:path 
error:NULL])
             success2 = [self removeFileAtPath:notePath handler:nil];
@@ -206,6 +216,7 @@
             success3 = [self removeFileAtPath:notePath handler:nil];
         if (notePath = [self notesFileWithExtension:FDF_EXTENSION atPath:path 
error:NULL])
             [self removeFileAtPath:notePath handler:nil];
+#endif
         if (success1 == NO || success2 == NO || success3 == NO)
             error1 = error2 = error3 = [NSError 
errorWithDomain:NSPOSIXErrorDomain code:ENOENT userInfo:[NSDictionary 
dictionaryWithObjectsAndKeys:@"Could not remove notes file", 
NSLocalizedDescriptionKey, nil]];
     } else {

Modified: trunk/SkimNotes/SKNAgentListener.h
===================================================================
--- trunk/SkimNotes/SKNAgentListener.h  2009-09-10 22:25:40 UTC (rev 5741)
+++ trunk/SkimNotes/SKNAgentListener.h  2009-09-10 23:17:44 UTC (rev 5742)
@@ -38,7 +38,11 @@
 #import <Foundation/Foundation.h>
 
 
-...@interface SKNAgentListener : NSObject {
+...@interface SKNAgentListener : NSObject
+#if defined(MAC_OS_X_VERSION_10_5) && MAC_OS_X_VERSION_MAX_ALLOWED > 
MAC_OS_X_VERSION_10_5
+    <NSConnectionDelegate>
+#endif
+{
     NSConnection *connection;
 }
 

Modified: trunk/SkimNotes/SkimNotes.xcodeproj/project.pbxproj
===================================================================
--- trunk/SkimNotes/SkimNotes.xcodeproj/project.pbxproj 2009-09-10 22:25:40 UTC 
(rev 5741)
+++ trunk/SkimNotes/SkimNotes.xcodeproj/project.pbxproj 2009-09-10 23:17:44 UTC 
(rev 5742)
@@ -3,7 +3,7 @@
        archiveVersion = 1;
        classes = {
        };
-       objectVersion = 44;
+       objectVersion = 45;
        objects = {
 
 /* Begin PBXAggregateTarget section */

Modified: trunk/SkimNotes/skimnotes.m
===================================================================
--- trunk/SkimNotes/skimnotes.m 2009-09-10 22:25:40 UTC (rev 5741)
+++ trunk/SkimNotes/skimnotes.m 2009-09-10 23:17:44 UTC (rev 5742)
@@ -290,7 +290,11 @@
                     if ([data length]) {
                         success = [data writeToFile:notesPath 
options:NSAtomicWrite error:&error];
                     } else if ([fm fileExistsAtPath:notesPath 
isDirectory:&isDir] && isDir == NO) {
+#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4
+                        success = [fm removeItemAtPath:notesPath error:NULL];
+#else
                         success = [fm removeFileAtPath:notesPath handler:nil];
+#endif
                         if (success == NO)
                             error = [NSError 
errorWithDomain:NSPOSIXErrorDomain code:EACCES userInfo:[NSDictionary 
dictionaryWithObjectsAndKeys:@"Unable to remove file", 
NSLocalizedDescriptionKey, nil]];
                     } else {
@@ -345,9 +349,18 @@
                 }
                 if (filename)
                     pdfFilePath = [pdfPath 
stringByAppendingPathComponent:filename];
+#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4
+                success = [fm copyItemAtPath:pdfFilePath toPath:notesPath 
error:NULL];
+#else
                 success = [fm copyPath:pdfFilePath toPath:notesPath 
handler:nil];
+#endif
             } else {
-                if (success = [fm createDirectoryAtPath:notesPath 
attributes:nil]) {
+#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4
+                success = [fm createDirectoryAtPath:notesPath 
withIntermediateDirectories:NO attributes:nil error:NULL];
+#else
+                success = [fm createDirectoryAtPath:notesPath attributes:nil];
+#endif
+                if (success) {
                     NSString *pdfFilePath = [notesPath 
stringByAppendingPathComponent:[[[notesPath lastPathComponent] 
stringByDeletingPathExtension] stringByAppendingPathExtension:PDF_EXTENSION]];
                     success = [[NSData dataWithContentsOfFile:pdfPath 
options:0 error:&error] writeToFile:pdfFilePath options:0 error:&error];
                 }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to