-
Notifications
You must be signed in to change notification settings - Fork 6
/
lmms-kwidgetsaddons.patch
66 lines (61 loc) · 1.98 KB
/
lmms-kwidgetsaddons.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
--- a/src/gui/MainApplication.cpp
+++ b/src/gui/MainApplication.cpp
@@ -35,6 +35,19 @@ MainApplication::MainApplication(int& argc, char** argv) :
QApplication(argc, argv),
m_queuedFile()
{
+#if !defined(LMMS_BUILD_WIN32) && !defined(LMMS_BUILD_APPLE) && !defined(LMMS_BUILD_HAIKU) && QT_VERSION >= 0x050000
+ // Work around a bug of KXmlGui < 5.55
+ // which breaks the recent files menu
+ // https://bugs.kde.org/show_bug.cgi?id=337491
+ for (auto child : children())
+ {
+ if (child->inherits("KCheckAcceleratorsInitializer"))
+ {
+ delete child;
+ }
+ }
+#endif
+
#if defined(LMMS_BUILD_WIN32) && QT_VERSION >= 0x050000
installNativeEventFilter(this);
#endif
diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp
index e6971f96d..26532eb5b 100644
--- a/src/gui/MainWindow.cpp
+++ b/src/gui/MainWindow.cpp
@@ -33,7 +33,6 @@
#include <QMenuBar>
#include <QMessageBox>
#include <QShortcut>
-#include <QLibrary>
#include <QSplitter>
#include <QUrl>
#include <QWhatsThis>
@@ -65,21 +64,6 @@
#include "lmmsversion.h"
-#if !defined(LMMS_BUILD_WIN32) && !defined(LMMS_BUILD_APPLE) && !defined(LMMS_BUILD_HAIKU) && QT_VERSION >= 0x050000
-//Work around an issue on KDE5 as per https://bugs.kde.org/show_bug.cgi?id=337491#c21
-void disableAutoKeyAccelerators(QWidget* mainWindow)
-{
- using DisablerFunc = void(*)(QWidget*);
- QLibrary kf5WidgetsAddon("KF5WidgetsAddons", 5);
- DisablerFunc setNoAccelerators =
- reinterpret_cast<DisablerFunc>(kf5WidgetsAddon.resolve("_ZN19KAcceleratorManager10setNoAccelEP7QWidget"));
- if(setNoAccelerators)
- {
- setNoAccelerators(mainWindow);
- }
- kf5WidgetsAddon.unload();
-}
-#endif
MainWindow::MainWindow() :
@@ -92,9 +76,6 @@ MainWindow::MainWindow() :
m_metronomeToggle( 0 ),
m_session( Normal )
{
-#if !defined(LMMS_BUILD_WIN32) && !defined(LMMS_BUILD_APPLE) && !defined(LMMS_BUILD_HAIKU) && QT_VERSION >= 0x050000
- disableAutoKeyAccelerators(this);
-#endif
setAttribute( Qt::WA_DeleteOnClose );
QWidget * main_widget = new QWidget( this );