Skip to content

Commit

Permalink
FIX: AppController warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
samiamwork committed Jun 23, 2018
1 parent 4fc9fc3 commit 62b0458
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 32 deletions.
12 changes: 6 additions & 6 deletions FullNavView.m
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ - (void)keyDown:(NSEvent*)event
case 27 : // ESC
//case NSBackspaceCharacter : // backsapce
if (![self closeCurrent]) {
[[NSApp delegate] endFullNavigation];
[(AppController*)[NSApp delegate] endFullNavigation];
}
break;
}
Expand Down Expand Up @@ -470,10 +470,10 @@ - (void)openCurrentMovie:(FullNavItem*)item
[movie setRate:DEFAULT_PLAY_RATE];
}
else if ([item isMemberOfClass:[FullNavFileItem class]]) {
[[NSApp delegate] openFile:[(FullNavFileItem*)item path]];
[(AppController*)[NSApp delegate] openFile:[(FullNavFileItem*)item path]];
}
else if ([item isMemberOfClass:[FullNavURLItem class]]) {
[[NSApp delegate] openURL:[(FullNavURLItem*)item URL]];
[(AppController*)[NSApp delegate] openURL:[(FullNavURLItem*)item URL]];
}
}

Expand Down Expand Up @@ -565,10 +565,10 @@ - (void)showPreview:(NSTimer*)timer
}
else {
if ([item isMemberOfClass:[FullNavFileItem class]]) {
[[NSApp delegate] openFile:[(FullNavFileItem*)item path] option:OPTION_ALL];
[(AppController*)[NSApp delegate] openFile:[(FullNavFileItem*)item path] option:OPTION_ALL];
}
else if ([item isMemberOfClass:[FullNavURLItem class]]) {
[[NSApp delegate] openURL:[(FullNavURLItem*)item URL]];
[(AppController*)[NSApp delegate] openURL:[(FullNavURLItem*)item URL]];
}
[[_movieView window] disableScreenUpdatesUntilFlush]; // for Tiger
[_movieView setFrame:[self previewRect]];
Expand All @@ -593,7 +593,7 @@ - (void)hidePreview
{
//TRACE(@"%s", __PRETTY_FUNCTION__);
if (![self isHidden] && ![_movieView isHidden]) {
[[NSApp delegate] closeMovie];
[(AppController*)[NSApp delegate] closeMovie];
[_movieView setError:nil info:nil];
[_movieView display];
[_movieView setHidden:TRUE];
Expand Down
2 changes: 1 addition & 1 deletion FullWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ - (void)setMovieView:(MMovieView*)movieView
_movieView = [movieView retain];
[[self contentView] addSubview:_movieView];

if ([[NSApp delegate] movie]) {
if ([(AppController*)[NSApp delegate] movie]) {
// full-screen transition from window-mode
[_movieView setFrame:[[self contentView] bounds]];
}
Expand Down
18 changes: 9 additions & 9 deletions MMovieView_DragDrop.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ - (NSDragOperation)draggingUpdated:(id<NSDraggingInfo>)sender
//TRACE(@"%s", __PRETTY_FUNCTION__);
unsigned int modifierFlags = [[NSApp currentEvent] modifierFlags];
if (modifierFlags & NSControlKeyMask) {
if ([[NSApp delegate] playlistWindowVisible]) {
[[NSApp delegate] hidePlaylistWindow];
if ([(AppController*)[NSApp delegate] playlistWindowVisible]) {
[(AppController*)[NSApp delegate] hidePlaylistWindow];
}
else {
[[NSApp delegate] showPlaylistWindow];
[(AppController*)[NSApp delegate] showPlaylistWindow];
}
}
else if (modifierFlags & NSAlternateKeyMask) {
Expand Down Expand Up @@ -138,23 +138,23 @@ - (BOOL)performDragOperation:(id<NSDraggingInfo>)sender
switch (_dragAction) {
case DRAG_ACTION_PLAY_FILES : {
NSArray* files = [pboard propertyListForType:NSFilenamesPboardType];
[[NSApp delegate] performSelector:@selector(openFiles:)
[(AppController*)[NSApp delegate] performSelector:@selector(openFiles:)
withObject:files afterDelay:0.01];
return TRUE;
}
case DRAG_ACTION_ADD_FILES : {
NSArray* files = [pboard propertyListForType:NSFilenamesPboardType];
[[NSApp delegate] addFiles:files];
[(AppController*)[NSApp delegate] addFiles:files];
return TRUE;
}
case DRAG_ACTION_REPLACE_SUBTITLE_FILES : {
NSArray* files = [pboard propertyListForType:NSFilenamesPboardType];
[[NSApp delegate] openSubtitleFiles:files];
[(AppController*)[NSApp delegate] openSubtitleFiles:files];
return TRUE;
}
case DRAG_ACTION_ADD_SUBTITLE_FILES : {
NSArray* files = [pboard propertyListForType:NSFilenamesPboardType];
[[NSApp delegate] addSubtitleFiles:files];
[(AppController*)[NSApp delegate] addSubtitleFiles:files];
return TRUE;
}
}
Expand All @@ -165,8 +165,8 @@ - (void)concludeDragOperation:(id<NSDraggingInfo>)sender
{
//TRACE(@"%s", __PRETTY_FUNCTION__);
_dragAction = DRAG_ACTION_NONE;
if ([[NSApp delegate] playlistWindowVisible]) {
[[NSApp delegate] hidePlaylistWindow];
if ([(AppController*)[NSApp delegate] playlistWindowVisible]) {
[(AppController*)[NSApp delegate] hidePlaylistWindow];
}
[self setDraggingVisualEffectEnabled:NO];
}
Expand Down
6 changes: 3 additions & 3 deletions MMovieView_Image.m
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ - (void)updateMovieRect:(BOOL)display
_movieRect = *(CGRect*)&mr;

float asw = 0;
if ([[NSApp delegate] isFullScreen] &&
if ([(AppController*)[NSApp delegate] isFullScreen] &&
NSEqualSizes(_movieSize, NSZeroSize)) {
asw = NSWidth(bounds);
}
Expand Down Expand Up @@ -298,11 +298,11 @@ - (NSRect)_calcMovieRectForBoundingRect:(NSRect)boundingRect
- (NSRect)calcMovieRectForBoundingRect:(NSRect)boundingRect
{
//TRACE(@"%s %@", __PRETTY_FUNCTION__, NSStringFromSize(boundingSize));
if ([[NSApp delegate] isFullScreen] && 0 < _fullScreenUnderScan) {
if ([(AppController*)[NSApp delegate] isFullScreen] && 0 < _fullScreenUnderScan) {
boundingRect = [self underScannedRect:boundingRect];
}

if ([[NSApp delegate] isFullScreen] || [[NSApp delegate] isDesktopBackground]) {
if ([(AppController*)[NSApp delegate] isFullScreen] || [(AppController*)[NSApp delegate] isDesktopBackground]) {
if (!NSEqualSizes(_movieSize, NSZeroSize)) {
if (NSWidth(boundingRect) < _movieSize.width ||
NSHeight(boundingRect) < _movieSize.height) {
Expand Down
20 changes: 10 additions & 10 deletions MainWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ - (IBAction)setAlwaysOnTop:(BOOL)alwaysOnTop
- (void)orderFrontRegardless
{
//TRACE(@"%s", __PRETTY_FUNCTION__);
if (!_alwaysOnTop && ![[NSApp delegate] isDesktopBackground]) {
if (!_alwaysOnTop && ![(AppController*)[NSApp delegate] isDesktopBackground]) {
[super orderFrontRegardless];
}
}

- (void)setLevel:(NSInteger)newLevel
{
//TRACE(@"%s %d", __PRETTY_FUNCTION__, newLevel);
if ([[NSApp delegate] isDesktopBackground]) {
if ([(AppController*)[NSApp delegate] isDesktopBackground]) {
newLevel = MIN(DesktopWindowLevel, newLevel);
}
[super setLevel:MIN(TopMostWindowLevel, newLevel)];
Expand All @@ -139,7 +139,7 @@ - (void)makeKeyAndOrderFront:(id)sender
- (BOOL)windowShouldClose:(id)sender
{
//TRACE(@"%s", __PRETTY_FUNCTION__);
[[NSApp delegate] closeMovie];
[(AppController*)[NSApp delegate] closeMovie];
return TRUE;
}

Expand All @@ -148,16 +148,16 @@ - (void)performClose:(id)sender
if ([NSApp keyWindow] == self) {
[super performClose:sender];
}
else if ([[NSApp delegate] isFullScreen]) {
[[NSApp delegate] endFullScreen];
else if ([(AppController*)[NSApp delegate] isFullScreen]) {
[(AppController*)[NSApp delegate] endFullScreen];
[super performClose:sender];
}
else if ([[NSApp delegate] isDesktopBackground]) {
[[NSApp delegate] endDesktopBackground];
else if ([(AppController*)[NSApp delegate] isDesktopBackground]) {
[(AppController*)[NSApp delegate] endDesktopBackground];
[super performClose:sender];
}
else if ([[NSApp delegate] isFullNavigation]) {
[[NSApp delegate] endFullNavigation];
else if ([(AppController*)[NSApp delegate] isFullNavigation]) {
[(AppController*)[NSApp delegate] endFullNavigation];
[super performClose:sender];
}
else {
Expand Down Expand Up @@ -218,7 +218,7 @@ - (void)mouseMoved:(NSEvent*)event
- (void)scrollWheel:(NSEvent*)event
{
//TRACE(@"%s", __PRETTY_FUNCTION__);
[[NSApp delegate] scrollWheelAction:event];
[(AppController*)[NSApp delegate] scrollWheelAction:event];
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion PlayPanel.m
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ - (void)scrollWheel:(NSEvent*)event
{
//TRACE(@"%s (%g,%g,%g)", __PRETTY_FUNCTION__,
// [event deltaX], [event deltaY], [event deltaZ]);
[[NSApp delegate] scrollWheelAction:event];
[(AppController*)[NSApp delegate] scrollWheelAction:event];
}

@end
2 changes: 1 addition & 1 deletion PreferenceController_Advanced.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ - (IBAction)updateCheckIntervalAction:(id)sender
- (IBAction)checkUpdateNowAction:(id)sender
{
//TRACE(@"%s", __PRETTY_FUNCTION__);
[[NSApp delegate] checkForUpdates:TRUE]; // manual checking
[(AppController*)[NSApp delegate] checkForUpdates:TRUE]; // manual checking
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion PreferenceController_Advanced_Details.m
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ - (void)outlineView:(NSOutlineView*)outlineView
[_movieView setCaptureFormat:[object intValue]];
}
else if ([key isEqualToString:MIncludeLetterBoxOnCaptureKey]) {
[[NSApp delegate] setIncludeLetterBoxOnCapture:[object boolValue]];
[(AppController*)[NSApp delegate] setIncludeLetterBoxOnCapture:[object boolValue]];
}
// subtitles
else if ([key isEqualToString:MUseQuickTimeSubtitlesKey]) {
Expand Down

0 comments on commit 62b0458

Please sign in to comment.