From 9fa6e8f627d0c61fd5a3b993903a362dc04bf707 Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Thu, 29 Sep 2011 14:29:05 +0200 Subject: Clean-up a macro for Cocoa MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the usage of Q_MAC_USE_COCOA and Carbon code paths. Change-Id: Ib569ad8c6d9ffe258f454b3c3b06e95294a10112 Reviewed-on: http://codereview.qt-project.org/5100 Reviewed-by: Morten Johan Sørvig Sanity-Review: Morten Johan Sørvig --- src/widgets/util/qcompleter.cpp | 4 ---- src/widgets/util/qsystemtrayicon_mac.mm | 20 -------------------- 2 files changed, 24 deletions(-) (limited to 'src/widgets/util') diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp index 39b7faf57f..358ecf0277 100644 --- a/src/widgets/util/qcompleter.cpp +++ b/src/widgets/util/qcompleter.cpp @@ -1133,11 +1133,7 @@ void QCompleter::setPopup(QAbstractItemView *popup) delete d->popup; if (popup->model() != d->proxy) popup->setModel(d->proxy); -#if defined(Q_OS_MAC) && !defined(QT_MAC_USE_COCOA) - popup->show(); -#else popup->hide(); -#endif Qt::FocusPolicy origPolicy = Qt::NoFocus; if (d->widget) diff --git a/src/widgets/util/qsystemtrayicon_mac.mm b/src/widgets/util/qsystemtrayicon_mac.mm index 4186ac3e55..5553c63723 100644 --- a/src/widgets/util/qsystemtrayicon_mac.mm +++ b/src/widgets/util/qsystemtrayicon_mac.mm @@ -188,12 +188,8 @@ void QSystemTrayIconPrivate::updateIcon_sys() { if(sys && !icon.isNull()) { QMacCocoaAutoReleasePool pool; -#ifndef QT_MAC_USE_COCOA - const short scale = GetMBarHeight()-4; -#else CGFloat hgt = [[[NSApplication sharedApplication] mainMenu] menuBarHeight]; const short scale = hgt - 4; -#endif NSImage *nsimage = static_cast(qt_mac_create_nsimage(icon.pixmap(QSize(scale, scale)))); [(NSImageView*)[[sys->item item] view] setImage: nsimage]; [nsimage release]; @@ -321,12 +317,8 @@ QT_END_NAMESPACE down = NO; if( ![self icon]->icon().isNull() ) { -#ifndef QT_MAC_USE_COCOA - const short scale = GetMBarHeight()-4; -#else CGFloat hgt = [[[NSApplication sharedApplication] mainMenu] menuBarHeight]; const short scale = hgt - 4; -#endif NSImage *nsimage = static_cast(qt_mac_create_nsimage([self icon]->icon().pixmap(QSize(scale, scale)))); [self setImage: nsimage]; [nsimage release]; @@ -344,12 +336,8 @@ QT_END_NAMESPACE int clickCount = [mouseEvent clickCount]; [self setNeedsDisplay:YES]; -#ifndef QT_MAC_USE_COCOA - const short scale = GetMBarHeight()-4; -#else CGFloat hgt = [[[NSApplication sharedApplication] mainMenu] menuBarHeight]; const short scale = hgt - 4; -#endif if (![self icon]->icon().isNull() ) { NSImage *nsaltimage = static_cast(qt_mac_create_nsimage([self icon]->icon().pixmap(QSize(scale, scale), QIcon::Selected))); @@ -453,10 +441,6 @@ QT_END_NAMESPACE qtsystray_sendActivated(icon, QSystemTrayIcon::Trigger); if (icon->contextMenu()) { -#ifndef QT_MAC_USE_COCOA - [[[self item] view] removeAllToolTips]; - iconPrivate->updateToolTip_sys(); -#endif NSMenu *m = [[QT_MANGLE_NAMESPACE(QNSMenu) alloc] initWithQMenu:icon->contextMenu()]; [m setAutoenablesItems: NO]; [[NSNotificationCenter defaultCenter] addObserver:imageCell @@ -533,11 +517,7 @@ private: [item setToolTip:(NSString*)QCFString::toCFStringRef(action->toolTip())]; const QIcon icon = action->icon(); if(!icon.isNull()) { -#ifndef QT_MAC_USE_COCOA - const short scale = GetMBarHeight(); -#else const short scale = [[NSApp mainMenu] menuBarHeight]; -#endif NSImage *nsimage = static_cast(qt_mac_create_nsimage(icon.pixmap(QSize(scale, scale)))); [item setImage: nsimage]; [nsimage release]; -- cgit v1.2.3