Cocoa: Remove dead code in QCocoaMenu*

Change-Id: I56136594f073295ced645d06f657187a54e84384
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
Gabriel de Dietrich 2013-04-24 13:52:05 +02:00 committed by The Qt Project
parent da55d48ad7
commit 7a1cdac052
3 changed files with 2 additions and 22 deletions

View File

@ -81,8 +81,6 @@ public:
void setMinimumWidth(int width); void setMinimumWidth(int width);
void setFont(const QFont &font); void setFont(const QFont &font);
void setParentItem(QCocoaMenuItem* item);
inline NSMenu *nsMenu() const inline NSMenu *nsMenu() const
{ return m_nativeMenu; } { return m_nativeMenu; }
inline NSMenuItem *nsMenuItem() const inline NSMenuItem *nsMenuItem() const

View File

@ -289,11 +289,6 @@ void QCocoaMenu::syncSeparatorsCollapsible(bool enable)
} }
} }
void QCocoaMenu::setParentItem(QCocoaMenuItem *item)
{
Q_UNUSED(item);
}
void QCocoaMenu::setEnabled(bool enabled) void QCocoaMenu::setEnabled(bool enabled)
{ {
m_enabled = enabled; m_enabled = enabled;

View File

@ -128,7 +128,6 @@ void QCocoaMenuItem::setMenu(QPlatformMenu *menu)
QCocoaAutoReleasePool pool; QCocoaAutoReleasePool pool;
m_menu = static_cast<QCocoaMenu *>(menu); m_menu = static_cast<QCocoaMenu *>(menu);
if (m_menu) { if (m_menu) {
m_menu->setParentItem(this);
} else { } else {
// we previously had a menu, but no longer // we previously had a menu, but no longer
// clear out our item so the nexy sync() call builds a new one // clear out our item so the nexy sync() call builds a new one
@ -254,23 +253,11 @@ NSMenuItem *QCocoaMenuItem::sync()
[m_native setTag:reinterpret_cast<NSInteger>(this)]; [m_native setTag:reinterpret_cast<NSInteger>(this)];
} }
// [m_native setHidden:YES];
// [m_native setHidden:NO];
[m_native setHidden: !m_isVisible]; [m_native setHidden: !m_isVisible];
[m_native setEnabled: m_enabled]; [m_native setEnabled: m_enabled];
QString text = m_text;
QKeySequence accel = m_shortcut;
{ QString text = mergeText();
int st = text.lastIndexOf(QLatin1Char('\t')); QKeySequence accel = mergeAccel();
if (st != -1) {
accel = QKeySequence(text.right(text.length()-(st+1)));
text.remove(st, text.length()-st);
}
}
text = mergeText();
accel = mergeAccel();
// Show multiple key sequences as part of the menu text. // Show multiple key sequences as part of the menu text.
if (accel.count() > 1) if (accel.count() > 1)