Revision: 5928
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5928&view=rev
Author:   hofman
Date:     2009-10-21 19:01:27 +0000 (Wed, 21 Oct 2009)

Log Message:
-----------
Conditionally replace deprecated NSFileManager methods and set deployment 
target 10 10.5

Modified Paths:
--------------
    trunk/vendorsrc/andymatuschak/Sparkle/Configurations/ConfigCommon.xcconfig
    trunk/vendorsrc/andymatuschak/Sparkle/SUAppcast.m
    trunk/vendorsrc/andymatuschak/Sparkle/SUBasicUpdateDriver.m
    trunk/vendorsrc/andymatuschak/Sparkle/SUPlainInstallerInternals.m
    trunk/vendorsrc/andymatuschak/Sparkle/SUUIBasedUpdateDriver.m
    trunk/vendorsrc/andymatuschak/Sparkle/relaunch.m

Modified: 
trunk/vendorsrc/andymatuschak/Sparkle/Configurations/ConfigCommon.xcconfig
===================================================================
--- trunk/vendorsrc/andymatuschak/Sparkle/Configurations/ConfigCommon.xcconfig  
2009-10-21 17:29:55 UTC (rev 5927)
+++ trunk/vendorsrc/andymatuschak/Sparkle/Configurations/ConfigCommon.xcconfig  
2009-10-21 19:01:27 UTC (rev 5928)
@@ -4,10 +4,6 @@
 ZERO_LINK = NO
 CURRENT_PROJECT_VERSION = 1.5
 SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
-MACOSX_DEPLOYMENT_TARGET[arch=ppc] = 10.4
-MACOSX_DEPLOYMENT_TARGET[arch=ppc64] = 10.5
-MACOSX_DEPLOYMENT_TARGET[arch=i386] = 10.4
-MACOSX_DEPLOYMENT_TARGET[arch=x86_64] = 10.5
 GCC_C_LANGUAGE_STANDARD = c99
 GCC_ENABLE_OBJC_EXCEPTIONS = YES
 GCC_DEBUGGING_SYMBOLS = full

Modified: trunk/vendorsrc/andymatuschak/Sparkle/SUAppcast.m
===================================================================
--- trunk/vendorsrc/andymatuschak/Sparkle/SUAppcast.m   2009-10-21 17:29:55 UTC 
(rev 5927)
+++ trunk/vendorsrc/andymatuschak/Sparkle/SUAppcast.m   2009-10-21 19:01:27 UTC 
(rev 5928)
@@ -60,7 +60,11 @@
        NSArray *xmlItems = nil;
        NSMutableArray *appcastItems = [NSMutableArray array];
        
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
     [[NSFileManager defaultManager] removeFileAtPath:downloadFilename 
handler:nil];
+#else
+    [[NSFileManager defaultManager] removeItemAtPath:downloadFilename 
error:NULL];
+#endif
     [downloadFilename release];
     downloadFilename = nil;
     
@@ -177,8 +181,14 @@
 {
        CFRelease(download);
     
-    if (downloadFilename)
-        [[NSFileManager defaultManager] removeFileAtPath:downloadFilename 
handler:nil];
+       if (downloadFilename)
+       {
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
+               [[NSFileManager defaultManager] 
removeFileAtPath:downloadFilename handler:nil];
+#else
+               [[NSFileManager defaultManager] 
removeItemAtPath:downloadFilename error:NULL];
+#endif
+       }
     [downloadFilename release];
     downloadFilename = nil;
     

Modified: trunk/vendorsrc/andymatuschak/Sparkle/SUBasicUpdateDriver.m
===================================================================
--- trunk/vendorsrc/andymatuschak/Sparkle/SUBasicUpdateDriver.m 2009-10-21 
17:29:55 UTC (rev 5927)
+++ trunk/vendorsrc/andymatuschak/Sparkle/SUBasicUpdateDriver.m 2009-10-21 
19:01:27 UTC (rev 5928)
@@ -144,7 +144,11 @@
        int cnt=1;
        while ([[NSFileManager defaultManager] fileExistsAtPath:tempDir] && cnt 
<= 999)
                tempDir = [NSTemporaryDirectory() 
stringByAppendingPathComponent:[NSString stringWithFormat:@"%@ %d", prefix, 
cnt++]];
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
        BOOL success = [[NSFileManager defaultManager] 
createDirectoryAtPath:tempDir attributes:nil];
+#else
+       BOOL success = [[NSFileManager defaultManager] 
createDirectoryAtPath:tempDir withIntermediateDirectories:YES attributes:nil 
error:NULL];
+#endif
        if (!success)
        {
                // Okay, something's really broken with /tmp
@@ -228,8 +232,13 @@
        NSString *relaunchPathToCopy = [[NSBundle bundleForClass:[self class]]  
pathForResource:@"relaunch" ofType:@""];
        NSString *targetPath = [NSTemporaryDirectory() 
stringByAppendingPathComponent:[relaunchPathToCopy lastPathComponent]];
        // Only the paranoid survive: if there's already a stray copy of 
relaunch there, we would have problems
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
        [[NSFileManager defaultManager] removeFileAtPath:targetPath 
handler:nil];
        if ([[NSFileManager defaultManager] copyPath:relaunchPathToCopy 
toPath:targetPath handler:nil])
+#else
+       [[NSFileManager defaultManager] removeItemAtPath:targetPath error:NULL];
+       if ([[NSFileManager defaultManager] copyItemAtPath:relaunchPathToCopy 
toPath:targetPath error:NULL])
+#endif
                relaunchPath = [targetPath retain];
        
        [SUInstaller installFromUpdateFolder:[downloadPath 
stringByDeletingLastPathComponent] overHost:host delegate:self 
synchronously:[self shouldInstallSynchronously] versionComparator:[self 
_versionComparator]];
@@ -279,13 +288,21 @@
 
 - (void)cleanUp
 {
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
        [[NSFileManager defaultManager] removeFileAtPath:[downloadPath 
stringByDeletingLastPathComponent] handler:nil]; 
+#else
+       [[NSFileManager defaultManager] removeItemAtPath:[downloadPath 
stringByDeletingLastPathComponent] error:NULL];  
+#endif
 }
 
 - (void)installerForHost:(SUHost *)aHost failedWithError:(NSError *)error
 {
        if (aHost != host) { return; }
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
        [[NSFileManager defaultManager] removeFileAtPath:relaunchPath 
handler:NULL]; // Clean up the copied relauncher.
+#else
+       [[NSFileManager defaultManager] removeItemAtPath:relaunchPath 
error:NULL]; // Clean up the copied relauncher.
+#endif
        [self abortUpdateWithError:[NSError 
errorWithDomain:SUSparkleErrorDomain code:SUInstallationError 
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An 
error occurred while installing the update. Please try again later.", nil), 
NSLocalizedDescriptionKey, [error localizedDescription], 
NSLocalizedFailureReasonErrorKey, nil]]];
 }
 

Modified: trunk/vendorsrc/andymatuschak/Sparkle/SUPlainInstallerInternals.m
===================================================================
--- trunk/vendorsrc/andymatuschak/Sparkle/SUPlainInstallerInternals.m   
2009-10-21 17:29:55 UTC (rev 5927)
+++ trunk/vendorsrc/andymatuschak/Sparkle/SUPlainInstallerInternals.m   
2009-10-21 19:01:27 UTC (rev 5928)
@@ -309,7 +309,11 @@
        // Only recurse if it's actually a directory.  Don't recurse into a
        // root-level symbolic link.
        NSDictionary* rootAttributes =
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
        [[NSFileManager defaultManager] fileAttributesAtPath:root 
traverseLink:NO];
+#else
+       [[NSFileManager defaultManager] attributesOfItemAtPath:root error:NULL];
+#endif
        NSString* rootType = [rootAttributes objectForKey:NSFileType];
        
        if (rootType == NSFileTypeDirectory) {

Modified: trunk/vendorsrc/andymatuschak/Sparkle/SUUIBasedUpdateDriver.m
===================================================================
--- trunk/vendorsrc/andymatuschak/Sparkle/SUUIBasedUpdateDriver.m       
2009-10-21 17:29:55 UTC (rev 5927)
+++ trunk/vendorsrc/andymatuschak/Sparkle/SUUIBasedUpdateDriver.m       
2009-10-21 19:01:27 UTC (rev 5928)
@@ -122,7 +122,11 @@
 {
        // We do this here instead of in extractUpdate so that we only have a 
determinate progress bar for archives with progress.
        if ([statusController maxProgressValue] == 0)
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
                [statusController setMaxProgressValue:[[[[NSFileManager 
defaultManager] fileAttributesAtPath:downloadPath traverseLink:NO] 
objectForKey:NSFileSize] doubleValue]];
+#else
+               [statusController setMaxProgressValue:[[[[NSFileManager 
defaultManager] attributesOfItemAtPath:downloadPath error:NULL] 
objectForKey:NSFileSize] doubleValue]];
+#endif
        [statusController setProgressValue:[statusController progressValue] + 
length];
 }
 

Modified: trunk/vendorsrc/andymatuschak/Sparkle/relaunch.m
===================================================================
--- trunk/vendorsrc/andymatuschak/Sparkle/relaunch.m    2009-10-21 17:29:55 UTC 
(rev 5927)
+++ trunk/vendorsrc/andymatuschak/Sparkle/relaunch.m    2009-10-21 19:01:27 UTC 
(rev 5928)
@@ -39,7 +39,11 @@
 - (void) relaunch
 {
        [[NSWorkspace sharedWorkspace] openFile:[[NSFileManager defaultManager] 
stringWithFileSystemRepresentation:executablePath 
length:strlen(executablePath)]];
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
        [[NSFileManager defaultManager] 
removeFileAtPath:[NSTemporaryDirectory() 
stringByAppendingPathComponent:@"relaunch"] handler:nil];
+#else
+       [[NSFileManager defaultManager] 
removeItemAtPath:[NSTemporaryDirectory() 
stringByAppendingPathComponent:@"relaunch"] error:NULL];
+#endif
        exit(0);
 }
 


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

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to