summaryrefslogtreecommitdiffstats
path: root/macosx/HBQueueController.mm
diff options
context:
space:
mode:
authorritsuka <[email protected]>2009-03-02 11:42:11 +0000
committerritsuka <[email protected]>2009-03-02 11:42:11 +0000
commit65fc1a37cbe9ebc3414dcfec737c3dc38fa754b5 (patch)
treee9b934b556aeac012e6adbb948e16d125c8fcadb /macosx/HBQueueController.mm
parent5a3b2852dd432577b6efb7ffb917b44e6850c525 (diff)
MacGui:
- Switched some float to CGFloat and int to NSInteger. - Fixed a warning in writeToActivityLog: when compiling with gcc-4.2 - Fixed an issue when dragging items in the queue if the item was not already selected. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2199 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBQueueController.mm')
-rw-r--r--macosx/HBQueueController.mm25
1 files changed, 10 insertions, 15 deletions
diff --git a/macosx/HBQueueController.mm b/macosx/HBQueueController.mm
index 3e1b1f59b..39fb40ce0 100644
--- a/macosx/HBQueueController.mm
+++ b/macosx/HBQueueController.mm
@@ -142,9 +142,7 @@ static NSString* HBQueuePauseResumeToolbarIdentifier = @"HBQueuePauseRe
*/
int i = 0;
- NSEnumerator *enumerator = [fJobGroups objectEnumerator];
- id tempObject;
- while (tempObject = [enumerator nextObject])
+ for(id tempObject in fJobGroups)
{
NSDictionary *thisQueueDict = tempObject;
if ([[thisQueueDict objectForKey:@"Status"] intValue] == 0) // Completed
@@ -478,12 +476,14 @@ static NSString* HBQueuePauseResumeToolbarIdentifier = @"HBQueuePauseRe
- (IBAction)removeSelectedQueueItem: (id)sender
{
NSIndexSet * selectedRows = [fOutlineView selectedRowIndexes];
- int row = [selectedRows firstIndex];
+ NSUInteger row = [selectedRows firstIndex];
+ if( row == NSNotFound )
+ return;
/* if this is a currently encoding job, we need to be sure to alert the user,
* to let them decide to cancel it first, then if they do, we can come back and
* remove it */
- if ([[[fJobGroups objectAtIndex:row] objectForKey:@"Status"] intValue] == 1)
+ if ([[[fJobGroups objectAtIndex:row] objectForKey:@"Status"] integerValue] == 1)
{
/* We pause the encode here so that it doesn't finish right after and then
* screw up the sync while the window is open
@@ -1293,7 +1293,7 @@ return ![(HBQueueOutlineView*)outlineView isDragging];
- (BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray *)items toPasteboard:(NSPasteboard *)pboard
{
// Dragging is only allowed of the pending items.
- if ([[[fJobGroups objectAtIndex:[outlineView selectedRow]] objectForKey:@"Status"] intValue] != 2) // 2 is pending
+ if ([[[items objectAtIndex:0] objectForKey:@"Status"] integerValue] != 2) // 2 is pending
{
return NO;
}
@@ -1343,18 +1343,13 @@ return ![(HBQueueOutlineView*)outlineView isDragging];
return NSDragOperationGeneric;
}
-
-
- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id <NSDraggingInfo>)info item:(id)item childIndex:(NSInteger)index
{
- NSMutableIndexSet *moveItems = [NSMutableIndexSet indexSet];
-
- id obj;
- NSEnumerator *enumerator = [fDraggedNodes objectEnumerator];
- while (obj = [enumerator nextObject])
- {
+ NSMutableIndexSet *moveItems = [NSMutableIndexSet indexSet];
+
+ for( id obj in fDraggedNodes )
[moveItems addIndex:[fJobGroups indexOfObject:obj]];
- }
+
// Successful drop, we use moveObjectsInQueueArray:... in fHBController
// to properly rearrange the queue array, save it to plist and then send it back here.
// since Controller.mm is handling all queue array manipulation.