equal
deleted
inserted
replaced
74 [aboutItem setHidden:YES]; |
74 [aboutItem setHidden:YES]; |
75 } |
75 } |
76 |
76 |
77 - (void)ensureAppMenuInMenu:(NSMenu *)menu |
77 - (void)ensureAppMenuInMenu:(NSMenu *)menu |
78 { |
78 { |
|
79 // The application menu is the menu in the menu bar that contains the |
|
80 // 'Quit' item. When changing menu bar (e.g when swithing between |
|
81 // windows with different menu bars), we never recreate this menu, but |
|
82 // instead pull it out the current menu bar and place into the new one: |
79 NSMenu *mainMenu = [NSApp mainMenu]; |
83 NSMenu *mainMenu = [NSApp mainMenu]; |
80 if ([NSApp mainMenu] == menu) |
84 if ([NSApp mainMenu] == menu) |
81 return; // nothing to do! |
85 return; // nothing to do (menu is the current menu bar)! |
|
86 |
82 #ifndef QT_NAMESPACE |
87 #ifndef QT_NAMESPACE |
83 Q_ASSERT(mainMenu); |
88 Q_ASSERT(mainMenu); |
84 #endif |
89 #endif |
85 // Grab the app menu out of the current menu. |
90 // Grab the app menu out of the current menu. |
86 int numItems = [mainMenu numberOfItems]; |
91 int numItems = [mainMenu numberOfItems]; |