Skip to content
Snippets Groups Projects
Commit a15db16e authored by George Nachman's avatar George Nachman
Browse files

Update tab bar sanity check to log when dragging ends (it was called too soon)...

Update tab bar sanity check to log when dragging ends (it was called too soon) and to log more info. Issue 5055
parent 01e929e1
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -226,7 +226,12 @@ const NSInteger kPSMStartResizeAnimation = 0;
}
 
- (void)sanityCheck:(NSString *)callsite {
if ([[PSMTabDragAssistant sharedDragAssistant] isDragging]) {
[self sanityCheck:callsite force:NO];
}
- (void)sanityCheck:(NSString *)callsite force:(BOOL)force {
if (!force && [[PSMTabDragAssistant sharedDragAssistant] isDragging]) {
ILog(@"Skip sanity check during drag from callsite %@", callsite);
return;
}
if (self.tabView.tabViewItems.count != self.cells.count) {
Loading
Loading
@@ -239,6 +244,7 @@ const NSInteger kPSMStartResizeAnimation = 0;
[self sanityCheckFailedWithCallsite:callsite reason:@"cells[i].representedObject != tabView.tabViewItems[i].representedObject"];
}
}
NSLog(@"Sanity check passed. cells=%@. tabView.tabViewITems=%@", self.cells, self.tabView.tabViewItems);
}
}
 
Loading
Loading
Loading
Loading
@@ -439,17 +439,23 @@
didDropTabViewItem:[[self draggedCell] representedObject]
inTabBar:[self destinationTabBar]];
}
[[self destinationTabBar] sanityCheck:@"destination performDragOperation"];
[[self sourceTabBar] sanityCheck:@"source performDragOperation"];
}
 
[[NSNotificationCenter defaultCenter] postNotificationName:PSMTabDragDidEndNotification object:nil];
 
PSMTabBarControl *destination = [[[self destinationTabBar] retain] autorelease];
PSMTabBarControl *source = [[[self sourceTabBar] retain] autorelease];
[self finishDrag];
[destination sanityCheck:@"destination performDragOperation"];
[source sanityCheck:@"source performDragOperation"];
}
 
- (void)draggedImageEndedAt:(NSPoint)aPoint operation:(NSDragOperation)operation {
if ([self isDragging]) { // means there was not a successful drop (performDragOperation)
PSMTabBarControl *destination = [[[self destinationTabBar] retain] autorelease];
PSMTabBarControl *source = [[[self sourceTabBar] retain] autorelease];
id sourceDelegate = [[self sourceTabBar] delegate];
 
//split off the dragged tab into a new window
Loading
Loading
@@ -520,7 +526,7 @@
}
[control sanityCheck:@"add dragged tab to new window"];
} else {
NSLog(@"Delegate returned no control to add to.");
ELog(@"Delegate returned no control to add to.");
[[[self sourceTabBar] cells] insertObject:[self draggedCell] atIndex:[self draggedCellIndex]];
[[[self sourceTabBar] window] setAlphaValue:1]; // Make the window visible again.
[[[self sourceTabBar] window] orderFront:nil];
Loading
Loading
@@ -536,6 +542,9 @@
[[NSNotificationCenter defaultCenter] postNotificationName:PSMTabDragDidEndNotification object:nil];
 
[self finishDrag];
[source sanityCheck:@"draggedImageEndedAt - source"];
[destination sanityCheck:@"draggedImageEndedAt - destination"];
}
}
 
Loading
Loading
Loading
Loading
@@ -62,5 +62,6 @@ Protocol to be observed by all style delegate objects. These objects handle the
 
- (NSMutableArray *)cells;
- (void)sanityCheck:(NSString *)callsite;
- (void)sanityCheck:(NSString *)callsite force:(BOOL)force;
 
@end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment