From: Stephan Witt Date: Sun, 24 Aug 2014 18:29:52 +0000 (+0200) Subject: Remove special GlobalMenuBar class. As Patrick De Visschere pointed out it is not... X-Git-Tag: 2.2.0alpha1~1712 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f73091228c9b0661d5a6f9b36da018b77da74a19;p=lyx.git Remove special GlobalMenuBar class. As Patrick De Visschere pointed out it is not needed. The shortcut handling of Qt does it internally now what GlobalMenuBar was made for. --- diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 5ee0c5883f..56cbd60417 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -651,28 +651,6 @@ public: } }; -class GlobalMenuBar : public QMenuBar -{ -public: - /// - GlobalMenuBar() : QMenuBar(0) {} - - /// - bool event(QEvent * e) - { - if (e->type() == QEvent::ShortcutOverride) { - // && activeWindow() == 0) { - QKeyEvent * ke = static_cast(e); - KeySymbol sym; - setKeySymbol(&sym, ke); - guiApp->processKeySym(sym, q_key_state(ke->modifiers())); - e->accept(); - return true; - } - return false; - } -}; - #ifdef Q_WS_MACX // QMacPasteboardMimeGraphics can only be compiled on Mac. @@ -951,7 +929,7 @@ struct GuiApplication::Private QHash views_; /// Only used on mac. - GlobalMenuBar * global_menubar_; + QMenuBar * global_menubar_; #ifdef Q_WS_MACX /// Linkback mime handler for MacOSX. @@ -2350,7 +2328,7 @@ void GuiApplication::execBatchCommands() // Create the global default menubar which is shown for the dialogs // and if no GuiView is visible. // This must be done after the session was recovered to know the "last files". - d->global_menubar_ = new GlobalMenuBar; + d->global_menubar_ = new QMenuBar(0); d->menus_.fillMenuBar(d->global_menubar_, 0, true); #endif diff --git a/src/frontends/qt4/GuiApplication.h b/src/frontends/qt4/GuiApplication.h index 57b37836c6..3d5b2d2d0f 100644 --- a/src/frontends/qt4/GuiApplication.h +++ b/src/frontends/qt4/GuiApplication.h @@ -37,7 +37,6 @@ class FileName; namespace frontend { class GuiView; -class GlobalMenuBar; class GuiWorkArea; class Menus; class SocketNotifier;