Ignore:
Timestamp:
Jan 12, 2006, 6:47:30 PM (17 years ago)
Author:
root
Message:

Update 2005-12-04

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r7 r11  
    851851}
    852852
     853- (BOOL) hasGrowl
     854{
     855    NSFileManager * manager = [NSFileManager defaultManager];
     856    NSString      * helper  = @"/Library/PreferencePanes/Growl.prefPane/"
     857                               "Contents/Resources/GrowlHelperApp.app";
     858
     859    if( [manager fileExistsAtPath: helper] )
     860    {
     861        /* Growl was installed for all users */
     862        return YES;
     863    }
     864    if( [manager fileExistsAtPath: [[NSString stringWithFormat: @"~%@",
     865            helper] stringByExpandingTildeInPath]] )
     866    {
     867        /* Growl was installed for this user only */
     868        return YES;
     869    }
     870
     871    return NO;
     872}
     873
    853874- (void) notifyGrowl: (NSString * ) file
    854875{
     
    856877    NSAppleScript * appleScript;
    857878    NSDictionary * error;
     879
     880    if( ![self hasGrowl] )
     881    {
     882        return;
     883    }
    858884   
    859885    growlScript = [NSString stringWithFormat:
     
    881907    NSAppleScript * appleScript;
    882908    NSDictionary * error;
     909
     910    if( ![self hasGrowl] )
     911    {
     912        return;
     913    }
    883914   
    884915    growlScript = [NSString stringWithFormat:
Note: See TracChangeset for help on using the changeset viewer.