Cocoa: clean up compiler warnings.

Change-Id: I2cb65bb455b79b218a317b21e5a3b0d9792e0e22
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
bb10
Morten Sorvig 2011-10-19 14:23:45 +02:00 committed by Qt by Nokia
parent 03fd37cdf4
commit f6e0a2f59f
7 changed files with 19 additions and 35 deletions

View File

@ -112,6 +112,7 @@ QT_USE_NAMESPACE
- (void)qt_sendPostedMessage:(NSEvent *)event
{
Q_UNUSED(event);
/*
// WARNING: data1 and data2 is truncated to from 64-bit to 32-bit on OS 10.5!
// That is why we need to split the address in two parts:
@ -140,6 +141,7 @@ QT_USE_NAMESPACE
- (BOOL)qt_filterEvent:(NSEvent *)event
{
Q_UNUSED(event);
/*
if (qApp->macEventFilter(0, reinterpret_cast<EventRef>(event)))
return true;

View File

@ -215,6 +215,8 @@ static void cleanupCocoaApplicationDelegate()
- (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames
{
Q_UNUSED(filenames);
Q_UNUSED(sender);
/*
for (NSString *fileName in filenames) {
QString qtFileName = qt_mac_NSStringToQString(fileName);
@ -249,6 +251,7 @@ static void cleanupCocoaApplicationDelegate()
- (void)applicationDidBecomeActive:(NSNotification *)notification
{
Q_UNUSED(notification);
/*
if (reflectionDelegate
&& [reflectionDelegate respondsToSelector:@selector(applicationDidBecomeActive:)])
@ -272,6 +275,7 @@ static void cleanupCocoaApplicationDelegate()
- (void)applicationDidResignActive:(NSNotification *)notification
{
Q_UNUSED(notification);
/*
if (reflectionDelegate
&& [reflectionDelegate respondsToSelector:@selector(applicationDidResignActive:)])
@ -328,6 +332,7 @@ static void cleanupCocoaApplicationDelegate()
- (void)getUrl:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
{
Q_UNUSED(event);
Q_UNUSED(replyEvent);
/*
NSString *urlString = [[event paramDescriptorForKeyword:keyDirectObject] stringValue];
@ -348,6 +353,7 @@ static void cleanupCocoaApplicationDelegate()
- (void)qtDispatcherToQAction:(id)sender
{
Q_UNUSED(sender);
//[[NSApp QT_MANGLE_NAMESPACE(qt_qcocoamenuLoader)] qtDispatcherToQAction:sender];
}

View File

@ -789,6 +789,9 @@ NSModalSession QCocoaEventDispatcherPrivate::currentModalSession()
static void setChildrenWorksWhenModal(QWindow *window, bool worksWhenModal)
{
Q_UNUSED(window)
Q_UNUSED(worksWhenModal)
// For NSPanels (but not NSWindows, sadly), we can set the flag
// worksWhenModal, so that they are active even when they are not modal.
/*

View File

@ -86,7 +86,7 @@ QCocoaIntegration::QCocoaIntegration()
qApp->setAttribute(Qt::AA_DontUseNativeMenuBar, false);
QNSApplication *cocoaApplication = [QNSApplication sharedApplication];
NSApplication *cocoaApplication = [NSApplication sharedApplication];
if (qgetenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM").isEmpty()) {
// Applications launched from plain executables (without an app

View File

@ -52,12 +52,6 @@
QT_BEGIN_NAMESPACE
@interface QNSWindow : NSWindow {
}
@end
class QCocoaWindow : public QPlatformWindow
{
public:
@ -82,14 +76,14 @@ public:
protected:
void determineWindowClass();
QNSWindow *createWindow();
NSWindow *createWindow();
NSRect globalGeometry(const QRect localWindowGeometry) const;
QRect windowGeometry() const;
QCocoaWindow *parentCocoaWindow() const;
private:
friend class QCocoaBackingStore;
QNSWindow *m_nsWindow;
NSWindow *m_nsWindow;
QNSView *m_contentView;
quint32 m_windowAttributes;
quint32 m_windowClass;

View File

@ -54,20 +54,6 @@
#include <QDebug>
@implementation QNSWindow
- (BOOL)canBecomeKeyWindow
{
return YES;
}
- (BOOL)canBecomeMainWindow
{
return YES;
}
@end
QCocoaWindow::QCocoaWindow(QWindow *tlw)
: QPlatformWindow(tlw)
, m_windowAttributes(0)
@ -285,7 +271,7 @@ void QCocoaWindow::determineWindowClass()
/*
*/
QNSWindow * QCocoaWindow::createWindow()
NSWindow * QCocoaWindow::createWindow()
{
// Determine if we need to add in our "custom window" attribute. Cocoa is rather clever
// in deciding if we need the maximize button or not (i.e., it's resizable, so you
@ -306,7 +292,7 @@ QNSWindow * QCocoaWindow::createWindow()
*/
NSRect frame = globalGeometry(window()->geometry());
QCocoaAutoReleasePool pool;
QNSWindow *window;
NSWindow *window;
switch (m_windowClass) {
case kMovableModalWindowClass:
@ -318,7 +304,7 @@ QNSWindow * QCocoaWindow::createWindow()
NSPanel *panel;
BOOL needFloating = NO;
BOOL worksWhenModal = (this->window()->windowType() == Qt::Popup);
//BOOL worksWhenModal = (this->window()->windowType() == Qt::Popup);
// Add in the extra flags if necessary.
switch (m_windowClass) {
@ -345,7 +331,7 @@ QNSWindow * QCocoaWindow::createWindow()
break;
}
default:
window = [[QNSWindow alloc] initWithContentRect:frame
window = [[NSWindow alloc] initWithContentRect:frame
styleMask:(NSResizableWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSTitledWindowMask)
backing:NSBackingStoreBuffered
defer:NO]; // Deferring window creation breaks OpenGL (the GL context is set up

View File

@ -105,14 +105,6 @@ bool qt_mac_watchingAboutToShow(QMenu *menu)
return menu; /* && menu->receivers(SIGNAL(aboutToShow()));*/
}
static int qt_mac_CountMenuItems(OSMenuRef menu)
{
if (menu) {
return [menu numberOfItems];
}
return 0;
}
void qt_mac_menu_collapseSeparators(NSMenu * theMenu, bool collapse)
{
QCocoaAutoReleasePool pool;
@ -201,6 +193,7 @@ static void cancelAllMenuTracking()
static bool actualMenuItemVisibility(const QCocoaMenuBar *mbp,
const QCocoaMenuAction *action)
{
Q_UNUSED(mbp);
bool visible = action->action->isVisible();
if (visible && action->action->text() == QString(QChar(0x14)))
return false;