Fixed sorting for non-0 padded files.

CQTexperiment
vspader 2009-02-28 09:41:37 -08:00
parent 983699ab2f
commit 3b9d20fdc5
3 changed files with 17 additions and 6 deletions

View File

@ -201,15 +201,11 @@
NSArray *sortedURLs;
if (sort == YES)
{
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"absoluteString" ascending:YES];
sortedURLs = [expandedURLs sortedArrayUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]];
[sortDescriptor release];
sortedURLs = [expandedURLs sortedArrayUsingSelector:@selector(compareTrackNumbers:)];
}
else
{
sortedURLs = [expandedURLs copy];
sortedURLs = expandedURLs;
}
for (url in sortedURLs)

View File

@ -14,3 +14,9 @@
- (NSComparisonResult)compareTrackNumbers:(NSString *)aString;
@end
@interface NSURL (CogSort)
- (NSComparisonResult)compareTrackNumbers:(NSURL *)aURL;
@end

View File

@ -19,3 +19,12 @@
}
@end
@implementation NSURL (CogSort)
- (NSComparisonResult)compareTrackNumbers:(NSURL *)aURL
{
return [[self absoluteString] compareTrackNumbers:[aURL absoluteString]];
}
@end