Changeset 234


Ignore:
Timestamp:
Apr 22, 2006, 4:44:56 PM (16 years ago)
Author:
titer
Message:

Use NSLog on Mac OS X for errors, cosmetic changes

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r211 r234  
    107107    }
    108108    else
    109         printf( "Could not IORegisterForSystemPower\n" );
     109        NSLog( @"Could not IORegisterForSystemPower" );
    110110
    111111    NSString * torrentPath, * downloadFolder, * paused;
     
    11031103    if( ![appleScript executeAndReturnError: &error] )
    11041104    {
    1105         printf( "Growl notify failed\n" );
     1105        NSLog( @"Growl notify failed" );
    11061106    }
    11071107    [appleScript release];
     
    11321132    if( ![appleScript executeAndReturnError: &error] )
    11331133    {
    1134         printf( "Growl registration failed\n" );
     1134        NSLog( @"Growl registration failed" );
    11351135    }
    11361136    [appleScript release];
  • trunk/macosx/Torrent.m

    r219 r234  
    2323#import "Torrent.h"
    2424#import "StringAdditions.h"
     25#import "Utils.h"
    2526
    2627@interface Torrent (Private)
     
    141142
    142143        case TR_STATUS_STOPPING:
    143             [fStatusString setString: @"Stopping..."];
     144            [fStatusString setString: [@"Stopping"
     145                stringByAppendingString: NS_ELLIPSIS]];
    144146            break;
    145147    }
     
    147149    if( fStat->error & TR_ETRACKER )
    148150    {
    149         [fInfoString setString: @"Error: "];
    150         [fInfoString appendString: [NSString
    151             stringWithUTF8String: fStat->trackerError]];
    152     }
    153 
    154     [fUploadString   setString: @""];
     151        [fInfoString setString: [@"Error: " stringByAppendingString:
     152            [NSString stringWithUTF8String: fStat->trackerError]]];
     153    }
     154
    155155    if( fStat->progress == 1.0 )
    156156    {
    157         [fDownloadString setString: @"Ratio: "];
    158         [fDownloadString appendString: [NSString stringForRatio:
    159             fStat->downloaded upload: fStat->uploaded]];
     157        [fDownloadString setString: [@"Ratio: " stringByAppendingString:
     158            [NSString stringForRatio: fStat->downloaded
     159            upload: fStat->uploaded]]];
    160160    }
    161161    else
    162162    {
    163         [fDownloadString setString: @"DL: "];
    164         [fDownloadString appendString: [NSString stringForSpeed:
    165             fStat->rateDownload]];
    166     }
    167     [fUploadString setString: @"UL: "];
    168     [fUploadString appendString: [NSString stringForSpeed:
    169         fStat->rateUpload]];
     163        [fDownloadString setString: [@"DL: " stringByAppendingString:
     164            [NSString stringForSpeed: fStat->rateDownload]]];
     165    }
     166    [fUploadString setString: [@"UL: " stringByAppendingString:
     167        [NSString stringForSpeed: fStat->rateUpload]]];
    170168}
    171169
     
    188186- (void) sleep
    189187{
    190     if( fStat->status & TR_STATUS_ACTIVE )
     188    if( ( fResumeOnWake = ( fStat->status & TR_STATUS_ACTIVE ) ) )
    191189    {
    192190        [self stop];
    193         fResumeOnWake = YES;
    194     }
    195     else
    196     {
    197         fResumeOnWake = NO;
    198191    }
    199192}
     
    381374                removeFileAtPath: path handler: nil] )
    382375        {
    383             printf( "Could not trash `%s'\n", [path UTF8String] );
     376            NSLog( [@"Could not trash " stringByAppendingString: path] );
    384377        }
    385378    }
Note: See TracChangeset for help on using the changeset viewer.