summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorMorten Sorvig <morten.sorvig@nokia.com>2011-10-19 14:23:45 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-23 10:23:23 +0200
commitf6e0a2f59f79ba6b20f2d4d00807d26b71fa9178 (patch)
tree3929c5179601ad15df2c5018882c9edeee34b442 /src/plugins
parent03fd37cdf403e35aaaab874be9bad033d250e39d (diff)
Cocoa: clean up compiler warnings.
Change-Id: I2cb65bb455b79b218a317b21e5a3b0d9792e0e22 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplication.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm6
-rw-r--r--src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm3
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h10
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm22
-rw-r--r--src/plugins/platforms/cocoa/qmenu_mac.mm9
7 files changed, 19 insertions, 35 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaapplication.mm b/src/plugins/platforms/cocoa/qcocoaapplication.mm
index 22c5624896..388e56db8e 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplication.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplication.mm
@@ -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;
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
index 6a2508359b..debda91243 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
@@ -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];
}
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
index 9525b47c65..84ee4750a4 100644
--- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
+++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
@@ -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.
/*
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index e4d3bb01dd..07006291ba 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -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
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index ce79d3967f..dde64a1859 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -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;
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index ffbce4084b..840d4d96da 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -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
diff --git a/src/plugins/platforms/cocoa/qmenu_mac.mm b/src/plugins/platforms/cocoa/qmenu_mac.mm
index f62e4a9fd2..dde6464392 100644
--- a/src/plugins/platforms/cocoa/qmenu_mac.mm
+++ b/src/plugins/platforms/cocoa/qmenu_mac.mm
@@ -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;