Fix compile warning on mac.
This commit is contained in:
parent
8a5455dc7e
commit
4fb6f92ad4
22
src/core/mac_delegate.h
Normal file
22
src/core/mac_delegate.h
Normal file
@ -0,0 +1,22 @@
|
||||
#import <AppKit/NSApplication.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
class PlatformInterface;
|
||||
|
||||
#ifdef SNOW_LEOPARD
|
||||
@interface AppDelegate :NSObject <NSApplicationDelegate> {
|
||||
#else
|
||||
@interface AppDelegate :NSObject {
|
||||
#endif
|
||||
PlatformInterface* application_handler_;
|
||||
NSMenu* dock_menu_;
|
||||
}
|
||||
|
||||
- (id) initWithHandler: (PlatformInterface*)handler;
|
||||
// NSApplicationDelegate
|
||||
- (BOOL) applicationShouldHandleReopen: (NSApplication*)app hasVisibleWindows:(BOOL)flag;
|
||||
- (NSMenu*) applicationDockMenu: (NSApplication*)sender;
|
||||
- (void) setDockMenu: (NSMenu*)menu;
|
||||
@end
|
||||
|
@ -34,6 +34,7 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "globalshortcuts.h"
|
||||
#include "mac_delegate.h"
|
||||
#include "mac_startup.h"
|
||||
#include "macglobalshortcutbackend.h"
|
||||
#include "utilities.h"
|
||||
@ -66,22 +67,6 @@
|
||||
- (void) mediaKeyEvent: (int)key state: (BOOL)state repeat: (BOOL)repeat;
|
||||
@end
|
||||
|
||||
#ifdef SNOW_LEOPARD
|
||||
@interface AppDelegate :NSObject <NSApplicationDelegate> {
|
||||
#else
|
||||
@interface AppDelegate :NSObject {
|
||||
#endif
|
||||
PlatformInterface* application_handler_;
|
||||
NSMenu* dock_menu_;
|
||||
}
|
||||
|
||||
- (id) initWithHandler: (PlatformInterface*)handler;
|
||||
// NSApplicationDelegate
|
||||
- (BOOL) applicationShouldHandleReopen: (NSApplication*)app hasVisibleWindows:(BOOL)flag;
|
||||
- (NSMenu*) applicationDockMenu: (NSApplication*)sender;
|
||||
- (void) setDockMenu: (NSMenu*)menu;
|
||||
@end
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
- (id) init {
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include "macsystemtrayicon.h"
|
||||
|
||||
#include "core/mac_delegate.h"
|
||||
#include "core/song.h"
|
||||
|
||||
#include <QAction>
|
||||
@ -83,7 +84,7 @@ class MacSystemTrayIconPrivate : boost::noncopyable {
|
||||
|
||||
// Don't look now.
|
||||
// This must be called after our custom NSApplicationDelegate has been set.
|
||||
[[NSApp delegate] setDockMenu:dock_menu_];
|
||||
[(AppDelegate*)([NSApp delegate]) setDockMenu:dock_menu_];
|
||||
|
||||
ClearNowPlaying();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user