┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dolphincontextmenu.cpp10
-rw-r--r--src/dolphincontextmenu.h3
2 files changed, 6 insertions, 7 deletions
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp
index 116edf4f0..da76e56fe 100644
--- a/src/dolphincontextmenu.cpp
+++ b/src/dolphincontextmenu.cpp
@@ -37,6 +37,7 @@
#include <kmenubar.h>
#include <kmessagebox.h>
#include <kmimetypetrader.h>
+#include <kmodifierkeyinfo.h>
#include <knewfilemenu.h>
#include <konqmimedata.h>
#include <konq_operations.h>
@@ -53,7 +54,7 @@
#include "views/dolphinview.h"
#include "views/viewmodecontroller.h"
-KModifierKeyInfo* DolphinContextMenu::m_keyInfo = 0;
+K_GLOBAL_STATIC(KModifierKeyInfo, m_keyInfo)
DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent,
const KFileItem& fileInfo,
@@ -127,9 +128,10 @@ void DolphinContextMenu::open()
void DolphinContextMenu::initializeModifierKeyInfo()
{
- if (m_keyInfo == 0) {
- m_keyInfo = new KModifierKeyInfo();
- }
+ // Access m_keyInfo, so that it gets instantiated by
+ // K_GLOBAL_STATIC
+ KModifierKeyInfo* keyInfo = m_keyInfo;
+ Q_UNUSED(keyInfo);
}
void DolphinContextMenu::slotKeyModifierPressed(Qt::Key key, bool pressed)
diff --git a/src/dolphincontextmenu.h b/src/dolphincontextmenu.h
index 028dc4649..2913114ac 100644
--- a/src/dolphincontextmenu.h
+++ b/src/dolphincontextmenu.h
@@ -25,7 +25,6 @@
#include <kservice.h>
#include <kurl.h>
#include <konq_copytomenu.h>
-#include <kmodifierkeyinfo.h>
#include <QtCore/QObject>
@@ -167,8 +166,6 @@ private:
bool m_shiftPressed;
QAction* m_removeAction; // Action that represents either 'Move To Trash' or 'Delete'
-
- static KModifierKeyInfo* m_keyInfo;
};
#endif