Added Remove Dead Items command
This commit is contained in:
parent
2d5f340011
commit
7a9e4a720c
3 changed files with 26 additions and 2 deletions
|
@ -85,7 +85,7 @@
|
||||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||||
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
|
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
|
||||||
</tableHeaderCell>
|
</tableHeaderCell>
|
||||||
<imageCell key="dataCell" controlSize="small" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="623CE0BD-CB51-4F0B-995B-E803BBE962CA" id="1801">
|
<imageCell key="dataCell" controlSize="small" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="DE10E5BB-5D9E-4B74-9085-7E5ACEFB1BB0" id="1801">
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
</imageCell>
|
</imageCell>
|
||||||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
|
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
|
||||||
|
@ -1165,6 +1165,12 @@ CA
|
||||||
<action selector="removeDuplicates:" target="218" id="bS3-zS-wcJ"/>
|
<action selector="removeDuplicates:" target="218" id="bS3-zS-wcJ"/>
|
||||||
</connections>
|
</connections>
|
||||||
</menuItem>
|
</menuItem>
|
||||||
|
<menuItem title="Remove Dead Items" id="Ajn-k4-afd" userLabel="Menu Item - Remove Dead Items">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="removeDeadItems:" target="218" id="vGZ-l5-tlE"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
<menuItem isSeparatorItem="YES" id="dfu-5S-1BE"/>
|
<menuItem isSeparatorItem="YES" id="dfu-5S-1BE"/>
|
||||||
<menuItem title="Add to Queue" id="1864"/>
|
<menuItem title="Add to Queue" id="1864"/>
|
||||||
<menuItem title="Remove from Queue" id="1865"/>
|
<menuItem title="Remove from Queue" id="1865"/>
|
||||||
|
@ -1780,7 +1786,7 @@ Gw
|
||||||
<customObject id="2434" customClass="FeedbackController"/>
|
<customObject id="2434" customClass="FeedbackController"/>
|
||||||
</objects>
|
</objects>
|
||||||
<resources>
|
<resources>
|
||||||
<image name="623CE0BD-CB51-4F0B-995B-E803BBE962CA" width="17" height="17">
|
<image name="DE10E5BB-5D9E-4B74-9085-7E5ACEFB1BB0" width="17" height="17">
|
||||||
<mutableData key="keyedArchiveRepresentation">
|
<mutableData key="keyedArchiveRepresentation">
|
||||||
YnBsaXN0MDDUAQIDBAUGRkdYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoK8QDwcI
|
YnBsaXN0MDDUAQIDBAUGRkdYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoK8QDwcI
|
||||||
ExQZHh8qKyw0NzpAQ1UkbnVsbNUJCgsMDQ4PEBESVk5TU2l6ZVYkY2xhc3NcTlNJbWFnZUZsYWdzVk5T
|
ExQZHh8qKyw0NzpAQ1UkbnVsbNUJCgsMDQ4PEBESVk5TU2l6ZVYkY2xhc3NcTlNJbWFnZUZsYWdzVk5T
|
||||||
|
|
|
@ -78,6 +78,7 @@ typedef enum {
|
||||||
- (IBAction)randomizeList:(id)sender;
|
- (IBAction)randomizeList:(id)sender;
|
||||||
|
|
||||||
- (IBAction)removeDuplicates:(id)sender;
|
- (IBAction)removeDuplicates:(id)sender;
|
||||||
|
- (IBAction)removeDeadItems:(id)sender;
|
||||||
|
|
||||||
- (IBAction)showEntryInFinder:(id)sender;
|
- (IBAction)showEntryInFinder:(id)sender;
|
||||||
- (IBAction)clearFilterPredicate:(id)sender;
|
- (IBAction)clearFilterPredicate:(id)sender;
|
||||||
|
|
|
@ -478,6 +478,23 @@
|
||||||
[originals release];
|
[originals release];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (IBAction)removeDeadItems:(id)sender {
|
||||||
|
NSMutableIndexSet *deadItems = [[NSMutableIndexSet alloc] init];
|
||||||
|
|
||||||
|
for (PlaylistEntry *pe in [self content])
|
||||||
|
{
|
||||||
|
NSURL *url = [pe URL];
|
||||||
|
if ([url isFileURL])
|
||||||
|
if (![[NSFileManager defaultManager] fileExistsAtPath:[url path]])
|
||||||
|
[deadItems addIndex:[pe index]];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ([deadItems count] > 0)
|
||||||
|
[self removeObjectsAtArrangedObjectIndexes:deadItems];
|
||||||
|
|
||||||
|
[deadItems release];
|
||||||
|
}
|
||||||
|
|
||||||
- (PlaylistEntry *)shuffledEntryAtIndex:(int)i
|
- (PlaylistEntry *)shuffledEntryAtIndex:(int)i
|
||||||
{
|
{
|
||||||
RepeatMode repeat = [self repeat];
|
RepeatMode repeat = [self repeat];
|
||||||
|
|
Loading…
Reference in a new issue