Changeset 1313

Show
Ignore:
Timestamp:
08/21/10 20:40:52 (21 months ago)
Author:
gbooker
Message:

If all importer is run and returns result without backgrounding, informer should be told.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/SapphireFrappliance/FRAppliance/SapphireImportHelper.m

    r1279 r1313  
    108108                [serverobj setClient:(SapphireImportHelperClient *)shared]; 
    109109                server = serverobj; 
    110                 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(connectionDidDie:) name:NSConnectionDidDieNotification object:nil];            
     110                [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(connectionDidDie:) name:NSConnectionDidDieNotification object:nil]; 
    111111        } 
    112112        @catch (NSException * e) { 
     113                [SapphireApplianceController logException:e]; 
    113114                keepRunning = NO; 
    114115        } 
     
    305306- (void)importAllData:(SapphireFileMetaData *)file inform:(id <SapphireImporterBackgroundProtocol>)inform; 
    306307{ 
    307         [informers setObject:inform forKey:[file path]]; 
    308         [allImporter importMetaData:file path:[file path]]; 
     308        NSString *path = [file path]; 
     309        [informers setObject:inform forKey:path]; 
     310        ImportState result = [allImporter importMetaData:file path:[file path]]; 
     311        switch (result) { 
     312                case ImportStateNotUpdated: 
     313                case ImportStateUpdated: 
     314                        [inform informComplete:result == ImportStateUpdated onPath:path]; 
     315                        [informers removeObjectForKey:path]; 
     316                        break; 
     317                default: 
     318                        break; 
     319        } 
    309320} 
    310321