Eliminated annoying flicker in Spotlight interface. Made tiny tweaks to PlaybackController and PlaylistController header to eliminate compiler warnings.
parent
b4804ebb5e
commit
387015db22
|
@ -198,7 +198,7 @@ double linearToLogarithmic(double linear)
|
|||
|
||||
- (IBAction)prev:(id)sender
|
||||
{
|
||||
if ([playlistController prev] == nil)
|
||||
if ([playlistController prev] == NO)
|
||||
return;
|
||||
|
||||
[self stop:self];
|
||||
|
|
|
@ -41,6 +41,9 @@
|
|||
- (void)setRepeat:(BOOL)r;
|
||||
- (BOOL)repeat;
|
||||
|
||||
- (PlaylistEntry *)getNextEntry:(PlaylistEntry *)pe;
|
||||
- (PlaylistEntry *)getPrevEntry:(PlaylistEntry *)pe;
|
||||
|
||||
/* Methods for undoing various actions */
|
||||
- (NSUndoManager *)undoManager;
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -10,6 +10,7 @@
|
|||
|
||||
@interface StringToURLTransformer: NSValueTransformer {}
|
||||
@end
|
||||
|
||||
@implementation StringToURLTransformer
|
||||
+ (Class)transformedValueClass { return [NSURL class]; }
|
||||
+ (BOOL)allowsReverseTransformation { return YES; }
|
||||
|
@ -27,4 +28,6 @@
|
|||
|
||||
return [value absoluteString];
|
||||
}
|
||||
@end
|
||||
|
||||
@end
|
|
@ -17,6 +17,7 @@
|
|||
NSMetadataQuery *query;
|
||||
NSString *searchString;
|
||||
NSString *spotlightSearchPath;
|
||||
NSArray *oldResults;
|
||||
}
|
||||
|
||||
- (IBAction)addToPlaylist:(id)sender;
|
||||
|
@ -27,5 +28,6 @@
|
|||
@property(retain) NSMetadataQuery *query;
|
||||
@property(copy) NSString *searchString;
|
||||
@property(copy) NSString *spotlightSearchPath;
|
||||
@property(retain) NSArray *oldResults;
|
||||
|
||||
@end
|
||||
|
|
|
@ -189,6 +189,7 @@ static NSPredicate * musicOnlyPredicate = nil;
|
|||
[self.query release];
|
||||
[self.searchString release];
|
||||
[musicOnlyPredicate release];
|
||||
[self.oldResults release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -202,6 +203,19 @@ static NSPredicate * musicOnlyPredicate = nil;
|
|||
[self.query enableUpdates];
|
||||
}
|
||||
|
||||
// Don't update the track list until some results have been gathered
|
||||
- (id)valueForKeyPath:(NSString *)keyPath
|
||||
{
|
||||
if([keyPath isEqualToString:@"query.results"])
|
||||
{
|
||||
if(([self.query.results count] == 0) && [self.query isGathering])
|
||||
return self.oldResults;
|
||||
self.oldResults = [NSArray arrayWithArray:self.query.results];
|
||||
return self.oldResults;
|
||||
}
|
||||
return [super valueForKeyPath:keyPath];
|
||||
}
|
||||
|
||||
#pragma mark NSMetadataQuery delegate methods
|
||||
|
||||
// replace the NSMetadataItem with a PlaylistEntry
|
||||
|
@ -249,4 +263,6 @@ replacementObjectForResultObject:(NSMetadataItem*)result
|
|||
}
|
||||
}
|
||||
|
||||
@synthesize oldResults;
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue