Wrote dealloc for SpotlightPlaylistEntry. Still need to find large leak.
This commit is contained in:
parent
ed261fb51a
commit
2124066761
3 changed files with 525 additions and 536 deletions
File diff suppressed because it is too large
Load diff
|
@ -45,17 +45,13 @@ static NSDictionary *importKeys;
|
||||||
{
|
{
|
||||||
SpotlightPlaylistEntry *entry = [[[SpotlightPlaylistEntry alloc]init]autorelease];
|
SpotlightPlaylistEntry *entry = [[[SpotlightPlaylistEntry alloc]init]autorelease];
|
||||||
|
|
||||||
// Dictionary of the metadata values
|
|
||||||
NSDictionary *songAttributes =
|
|
||||||
[metadataItem valuesForAttributes:[importKeys allKeys]];
|
|
||||||
|
|
||||||
// loop through the keys we want to extract
|
// loop through the keys we want to extract
|
||||||
for (NSString *mdKey in importKeys) {
|
for (NSString *mdKey in importKeys) {
|
||||||
id importTarget = [importKeys objectForKey:mdKey];
|
id importTarget = [importKeys objectForKey:mdKey];
|
||||||
// Just copy the object from metadata
|
// Just copy the object from metadata
|
||||||
if ([importTarget isKindOfClass:[NSString class]])
|
if ([importTarget isKindOfClass:[NSString class]])
|
||||||
{
|
{
|
||||||
[entry setValue: [songAttributes objectForKey:mdKey]
|
[entry setValue: [metadataItem valueForAttribute:mdKey]
|
||||||
forKey: importTarget];
|
forKey: importTarget];
|
||||||
}
|
}
|
||||||
// Transform the value in metadata before copying it in
|
// Transform the value in metadata before copying it in
|
||||||
|
@ -65,7 +61,7 @@ static NSDictionary *importKeys;
|
||||||
NSValueTransformer *transformer =
|
NSValueTransformer *transformer =
|
||||||
[NSValueTransformer valueTransformerForName:[importTarget objectAtIndex:1]];
|
[NSValueTransformer valueTransformerForName:[importTarget objectAtIndex:1]];
|
||||||
id transformedValue = [transformer transformedValue:
|
id transformedValue = [transformer transformedValue:
|
||||||
[songAttributes objectForKey:mdKey]];
|
[metadataItem valueForAttribute:mdKey]];
|
||||||
[entry setValue:transformedValue forKey: importKey];
|
[entry setValue:transformedValue forKey: importKey];
|
||||||
}
|
}
|
||||||
// The importKeys dictionary contains something strange...
|
// The importKeys dictionary contains something strange...
|
||||||
|
@ -85,6 +81,13 @@ static NSDictionary *importKeys;
|
||||||
return Nil;
|
return Nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)dealloc
|
||||||
|
{
|
||||||
|
spotlightTrack = Nil;
|
||||||
|
length = Nil;
|
||||||
|
[super dealloc];
|
||||||
|
}
|
||||||
|
|
||||||
@synthesize length;
|
@synthesize length;
|
||||||
@synthesize spotlightTrack;
|
@synthesize spotlightTrack;
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,6 @@ static NSPredicate * musicOnlyPredicate = nil;
|
||||||
|
|
||||||
NSValueTransformer *stringToSearchScopeTransformer = [[[StringToSearchScopeTransformer alloc]init]autorelease];
|
NSValueTransformer *stringToSearchScopeTransformer = [[[StringToSearchScopeTransformer alloc]init]autorelease];
|
||||||
[NSValueTransformer setValueTransformer:stringToSearchScopeTransformer forName:@"StringToSearchScopeTransformer"];
|
[NSValueTransformer setValueTransformer:stringToSearchScopeTransformer forName:@"StringToSearchScopeTransformer"];
|
||||||
|
|
||||||
[NSMetadataQuery exposeBinding:@"searchScopes"];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)registerDefaults
|
- (void)registerDefaults
|
||||||
|
@ -269,7 +267,6 @@ static NSPredicate * musicOnlyPredicate = nil;
|
||||||
{
|
{
|
||||||
self.query = nil;
|
self.query = nil;
|
||||||
self.searchString = nil;
|
self.searchString = nil;
|
||||||
[musicOnlyPredicate release];
|
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue