get rid of a warning

This commit is contained in:
Mitchell Livingston 2007-06-30 21:53:45 +00:00
parent 3b1597789e
commit f62addb8aa
2 changed files with 30 additions and 29 deletions

View File

@ -35,7 +35,7 @@
{
tr_handle_t * fLib;
tr_torrent_t * fHandle;
tr_info_t * fInfo;
const tr_info_t * fInfo;
tr_stat_t * fStat;
int fID;
@ -222,7 +222,7 @@
- (NSNumber *) ratioSortKey;
- (int) torrentID;
- (tr_info_t *) torrentInfo;
- (const tr_info_t *) torrentInfo;
- (tr_stat_t *) torrentStat;
@end

View File

@ -818,13 +818,13 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
if ([self allDownloaded] || ![fDefaults boolForKey: @"WarningRemainingSpace"])
return YES;
NSString * volumeName = [[[NSFileManager defaultManager] componentsToDisplayForPath: [self downloadFolder]]
objectAtIndex: 0];
NSString * volumeName;
if ((volumeName = [[[NSFileManager defaultManager] componentsToDisplayForPath: [self downloadFolder]] objectAtIndex: 0]))
{
NSDictionary * fsAttributes = [[NSFileManager defaultManager] fileSystemAttributesAtPath: [self downloadFolder]];
uint64_t remainingSpace = [[fsAttributes objectForKey: NSFileSystemFreeSize] unsignedLongLongValue],
torrentRemaining = fStat->left;
uint64_t remainingSpace = [[fsAttributes objectForKey: NSFileSystemFreeSize] unsignedLongLongValue];
if (volumeName && remainingSpace <= torrentRemaining)
if (remainingSpace <= fStat->left)
{
NSAlert * alert = [[NSAlert alloc] init];
[alert setMessageText: [NSString stringWithFormat:
@ -845,6 +845,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
return result != NSAlertFirstButtonReturn;
}
}
return YES;
}
@ -1443,7 +1444,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
return fID;
}
- (tr_info_t *) torrentInfo
- (const tr_info_t *) torrentInfo
{
return fInfo;
}