summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Sørvig <msorvig@trolltech.com>2009-07-29 05:14:47 (GMT)
committerMorten Sørvig <msorvig@trolltech.com>2009-07-29 05:14:47 (GMT)
commite570225ee8332602c85506ff87e2596173b68ecd (patch)
treea1204dbb7e7c03965b695faeab8726ffcfe0be00
parent188ac02e2fb6cc6437b776f8c5b69a508728fbdb (diff)
downloadQt-e570225ee8332602c85506ff87e2596173b68ecd.zip
Qt-e570225ee8332602c85506ff87e2596173b68ecd.tar.gz
Qt-e570225ee8332602c85506ff87e2596173b68ecd.tar.bz2
Compile on 10.4
Don't use the "for ... in" syntax. This is Objective-C 2, which is only supported on 10.5 and up.
-rw-r--r--src/gui/kernel/qt_cocoa_helpers_mac.mm5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm
index 1c4177e..ff4cb71 100644
--- a/src/gui/kernel/qt_cocoa_helpers_mac.mm
+++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm
@@ -1211,7 +1211,10 @@ void qt_mac_menu_collapseSeparators(void */*NSMenu **/ theMenu, bool collapse)
if (collapse) {
bool previousIsSeparator = true; // setting to true kills all the separators placed at the top.
NSMenuItem *previousItem = nil;
- for (NSMenuItem *item in [menu itemArray]) {
+
+ NSArray *itemArray = [menu itemArray];
+ for (unsigned int i = 0; i < [itemArray count]; ++i) {
+ NSMenuItem *item = reinterpret_cast<NSMenuItem *>([itemArray objectAtIndex:i]);
if ([item isSeparatorItem]) {
[item setHidden:previousIsSeparator];
}