mirror of
https://github.com/transmission/transmission
synced 2024-12-24 08:43:27 +00:00
Use NSLog on Mac OS X for errors, cosmetic changes
This commit is contained in:
parent
d598822024
commit
229d60507b
2 changed files with 17 additions and 24 deletions
|
@ -106,7 +106,7 @@ static void sleepCallBack( void * controller, io_service_t y,
|
|||
kCFRunLoopCommonModes );
|
||||
}
|
||||
else
|
||||
printf( "Could not IORegisterForSystemPower\n" );
|
||||
NSLog( @"Could not IORegisterForSystemPower" );
|
||||
|
||||
NSString * torrentPath, * downloadFolder, * paused;
|
||||
NSDictionary * dic;
|
||||
|
@ -1102,7 +1102,7 @@ static void sleepCallBack( void * controller, io_service_t y,
|
|||
appleScript = [[NSAppleScript alloc] initWithSource: growlScript];
|
||||
if( ![appleScript executeAndReturnError: &error] )
|
||||
{
|
||||
printf( "Growl notify failed\n" );
|
||||
NSLog( @"Growl notify failed" );
|
||||
}
|
||||
[appleScript release];
|
||||
}
|
||||
|
@ -1131,7 +1131,7 @@ static void sleepCallBack( void * controller, io_service_t y,
|
|||
appleScript = [[NSAppleScript alloc] initWithSource: growlScript];
|
||||
if( ![appleScript executeAndReturnError: &error] )
|
||||
{
|
||||
printf( "Growl registration failed\n" );
|
||||
NSLog( @"Growl registration failed" );
|
||||
}
|
||||
[appleScript release];
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#import "Torrent.h"
|
||||
#import "StringAdditions.h"
|
||||
#import "Utils.h"
|
||||
|
||||
@interface Torrent (Private)
|
||||
|
||||
|
@ -140,33 +141,30 @@
|
|||
break;
|
||||
|
||||
case TR_STATUS_STOPPING:
|
||||
[fStatusString setString: @"Stopping..."];
|
||||
[fStatusString setString: [@"Stopping"
|
||||
stringByAppendingString: NS_ELLIPSIS]];
|
||||
break;
|
||||
}
|
||||
|
||||
if( fStat->error & TR_ETRACKER )
|
||||
{
|
||||
[fInfoString setString: @"Error: "];
|
||||
[fInfoString appendString: [NSString
|
||||
stringWithUTF8String: fStat->trackerError]];
|
||||
[fInfoString setString: [@"Error: " stringByAppendingString:
|
||||
[NSString stringWithUTF8String: fStat->trackerError]]];
|
||||
}
|
||||
|
||||
[fUploadString setString: @""];
|
||||
if( fStat->progress == 1.0 )
|
||||
{
|
||||
[fDownloadString setString: @"Ratio: "];
|
||||
[fDownloadString appendString: [NSString stringForRatio:
|
||||
fStat->downloaded upload: fStat->uploaded]];
|
||||
[fDownloadString setString: [@"Ratio: " stringByAppendingString:
|
||||
[NSString stringForRatio: fStat->downloaded
|
||||
upload: fStat->uploaded]]];
|
||||
}
|
||||
else
|
||||
{
|
||||
[fDownloadString setString: @"DL: "];
|
||||
[fDownloadString appendString: [NSString stringForSpeed:
|
||||
fStat->rateDownload]];
|
||||
[fDownloadString setString: [@"DL: " stringByAppendingString:
|
||||
[NSString stringForSpeed: fStat->rateDownload]]];
|
||||
}
|
||||
[fUploadString setString: @"UL: "];
|
||||
[fUploadString appendString: [NSString stringForSpeed:
|
||||
fStat->rateUpload]];
|
||||
[fUploadString setString: [@"UL: " stringByAppendingString:
|
||||
[NSString stringForSpeed: fStat->rateUpload]]];
|
||||
}
|
||||
|
||||
- (void) start
|
||||
|
@ -187,14 +185,9 @@
|
|||
|
||||
- (void) sleep
|
||||
{
|
||||
if( fStat->status & TR_STATUS_ACTIVE )
|
||||
if( ( fResumeOnWake = ( fStat->status & TR_STATUS_ACTIVE ) ) )
|
||||
{
|
||||
[self stop];
|
||||
fResumeOnWake = YES;
|
||||
}
|
||||
else
|
||||
{
|
||||
fResumeOnWake = NO;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -380,7 +373,7 @@
|
|||
if( ![[NSFileManager defaultManager]
|
||||
removeFileAtPath: path handler: nil] )
|
||||
{
|
||||
printf( "Could not trash `%s'\n", [path UTF8String] );
|
||||
NSLog( [@"Could not trash " stringByAppendingString: path] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue