Changeset 903

Show
Ignore:
Timestamp:
05/26/08 13:51:49 (3 months ago)
Author:
astrange
Message:

Delete components when uninstalling instead of putting them in the trash.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CPFPerianPrefPaneController.m

    r792 r903  
    644644        NSDictionary *infoDict = [self myInfoDict]; 
    645645        NSDictionary *myComponentsInfo = [infoDict objectForKey:ComponentInfoDictionaryKey]; 
     646        NSFileManager *fileManager = [NSFileManager defaultManager]; 
     647        NSString *componentPath; 
    646648 
    647649        [errorString release]; 
     
    653655         
    654656        int tag = 0; 
    655         BOOL result = NO
     657        componentPath = [[self quickTimeComponentDir:userInstalled] stringByAppendingPathComponent:@"Perian.component"]
    656658        if(auth != nil && !userInstalled) 
    657                 [self _authenticatedRemove:[[self quickTimeComponentDir:userInstalled] stringByAppendingPathComponent:@"Perian.component"]]; 
    658         else 
    659                 result = [[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:[self quickTimeComponentDir:userInstalled] destination:@"" files:[NSArray arrayWithObject:@"Perian.component"] tag:&tag]; 
     659                [self _authenticatedRemove:componentPath]; 
     660        else 
     661                [fileManager removeFileAtPath:componentPath handler:nil]; 
    660662         
    661663        NSEnumerator *componentEnum = [myComponentsInfo objectEnumerator]; 
     
    665667                ComponentType type = [[myComponent objectForKey:ComponentTypeKey] intValue]; 
    666668                NSString *directory = [self basePathForType:type user:userInstalled]; 
     669                componentPath = [directory stringByAppendingPathComponent:[myComponent objectForKey:ComponentNameKey]]; 
    667670                if(auth != nil && !userInstalled) 
    668                         [self _authenticatedRemove:[directory stringByAppendingPathComponent:[myComponent objectForKey:ComponentNameKey]]]; 
     671                        [self _authenticatedRemove:componentPath]; 
    669672                else 
    670                         result = [[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:directory destination:@"" files:[NSArray arrayWithObject:[myComponent objectForKey:ComponentNameKey]] tag:&tag]; 
     673                        [fileManager removeFileAtPath:componentPath handler:nil]; 
    671674        } 
    672675        if(auth != nil)