Revision: 5474
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5474&view=rev
Author:   hofman
Date:     2009-07-13 12:25:49 +0000 (Mon, 13 Jul 2009)

Log Message:
-----------
Don't use new File Manager function on Tiger

Modified Paths:
--------------
    trunk/vendorsrc/andymatuschak/Sparkle/SUPlainInstallerInternals.m

Modified: trunk/vendorsrc/andymatuschak/Sparkle/SUPlainInstallerInternals.m
===================================================================
--- trunk/vendorsrc/andymatuschak/Sparkle/SUPlainInstallerInternals.m   
2009-07-11 11:38:08 UTC (rev 5473)
+++ trunk/vendorsrc/andymatuschak/Sparkle/SUPlainInstallerInternals.m   
2009-07-13 12:25:49 UTC (rev 5474)
@@ -185,6 +185,13 @@
        return res;
 }
 
++ (void)_movePathToTrash:(NSString *)path
+{
+       NSInteger tag = 0;
+       if (![[NSWorkspace sharedWorkspace] 
performFileOperation:NSWorkspaceRecycleOperation source:[path 
stringByDeletingLastPathComponent] destination:@"" files:[NSArray 
arrayWithObject:[path lastPathComponent]] tag:&tag])
+               NSLog(@"Sparkle error: couldn't move %@ to the trash. This is 
often a sign of a permissions error.", path);
+}
+
 + (BOOL)copyPathWithAuthentication:(NSString *)src overPath:(NSString *)dst 
temporaryName:(NSString *)tmp error:(NSError **)error
 {
        FSRef srcRef, dstRef, targetRef, movedRef;
@@ -224,8 +231,14 @@
        }
        
        // Trash the old copy of the app.
-       if (noErr != FSMoveObjectToTrashSync(&movedRef, NULL, 0))
+#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4
+       if (FSMoveObjectToTrashSync == NULL)
+               [self performSelectorOnMainThread:@selector(_movePathToTrash:) 
withObject:tmpPath waitUntilDone:YES];
+       else if (noErr != FSMoveObjectToTrashSync(&movedRef, NULL, 0))
                NSLog(@"Sparkle error: couldn't move %@ to the trash. This is 
often a sign of a permissions error.", tmpPath);
+#else
+       [self performSelectorOnMainThread:@selector(_movePathToTrash:) 
withObject:tmpPath waitUntilDone:YES];
+#endif
        
        // If the currently-running application is trusted, the new
        // version should be trusted as well.  Remove it from the


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

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to