Revision: 7501
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7501&view=rev
Author:   hofman
Date:     2011-09-21 16:48:49 +0000 (Wed, 21 Sep 2011)
Log Message:
-----------
use file manager on main thread

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

Modified: trunk/vendorsrc/andymatuschak/Sparkle/SUDiskImageUnarchiver.m
===================================================================
--- trunk/vendorsrc/andymatuschak/Sparkle/SUDiskImageUnarchiver.m       
2011-09-21 15:16:35 UTC (rev 7500)
+++ trunk/vendorsrc/andymatuschak/Sparkle/SUDiskImageUnarchiver.m       
2011-09-21 16:48:49 UTC (rev 7501)
@@ -66,34 +66,10 @@
     [NSTask launchedTaskWithLaunchPath:@"/usr/bin/hdiutil" arguments:[NSArray 
arrayWithObjects:@"detach", mountPoint, @"-force", nil]];
 }
 
-- (void)_extractDMG
+- (void)_extractDMGFromPath:(NSString *)mountPoint
 {              
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
        
-    // get a local copy of NSFileManager because this is running from a 
secondary thread
-    NSFileManager *fm;
-    if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_4)
-        fm = [[[NSFileManager alloc] init] autorelease];
-    else
-        fm = [NSFileManager defaultManager];
-    
-       // get a unique mount point path
-       NSString *mountPointName = nil;
-       NSString *mountPoint = nil;
-       do
-       {
-               CFUUIDRef uuid = CFUUIDCreate(NULL);
-               mountPointName = (NSString *)CFUUIDCreateString(NULL, uuid);
-               CFRelease(uuid);
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4
-               [NSMakeCollectable((CFStringRef)mountPointName) autorelease];
-#else
-               [mountPointName autorelease];
-#endif
-               mountPoint = [@"/Volumes" 
stringByAppendingPathComponent:mountPointName];
-       }
-       while ([fm fileExistsAtPath:mountPoint]);
-       
        NSArray* arguments = [NSArray arrayWithObjects:@"attach", archivePath, 
@"-mountpoint", mountPoint, @"-noverify", @"-nobrowse", @"-noautoopen", nil];
        // set up a pipe and push "yes" (y works too), this will accept any 
license agreement crap
        // not every .dmg needs this, but this will make sure it works with 
everyone
@@ -112,7 +88,18 @@
 
 - (void)start
 {
-    [NSThread detachNewThreadSelector:@selector(_extractDMG) toTarget:self 
withObject:nil];
+       NSString *mountPoint = nil;
+       do
+       {
+               CFUUIDRef uuid = CFUUIDCreate(NULL);
+               NSString *mountPointName = (NSString *)CFUUIDCreateString(NULL, 
uuid);
+               CFRelease(uuid);
+               mountPoint = [@"/Volumes" 
stringByAppendingPathComponent:mountPointName];
+        [mountPointName release];
+       }
+       while ([[NSFileManager defaultManager] fileExistsAtPath:mountPoint]);
+    
+    [NSThread detachNewThreadSelector:@selector(_extractDMGFromPath:) 
toTarget:self withObject:mountPoint];
 }
 
 + (void)load

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


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to