summaryrefslogtreecommitdiff
path: root/tizen
diff options
context:
space:
mode:
authorJinhyung Jo <jinhyung.jo@samsung.com>2016-11-04 11:46:47 +0900
committerSeokYeon Hwang <syeon.hwang@samsung.com>2016-11-08 11:49:43 +0900
commitc4b3287b13f9e63aa7588d410b64428c34ed2105 (patch)
tree479669e46a9c73e46baa5d5f6627d993060ab798 /tizen
parentffdc326b70237b660ac9a6a7cea3117d6c0f249f (diff)
downloadqemu-c4b3287b13f9e63aa7588d410b64428c34ed2105.tar.gz
qemu-c4b3287b13f9e63aa7588d410b64428c34ed2105.tar.bz2
qemu-c4b3287b13f9e63aa7588d410b64428c34ed2105.zip
keyboard: change the function to use
QMap::take(const Key &key) is more efficient. Short description for take(): "Removes the item with the key from the map and returns the value associated with it." For more information, see 'http://doc.qt.io/qt-5/qmap.html#take'. And the value function is a constant function. Change-Id: Ibdaf578c6eef49ebfa8beb3a00fc61785e4b74ed Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
Diffstat (limited to 'tizen')
-rw-r--r--tizen/src/ui/input/keyboardshortcut.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/tizen/src/ui/input/keyboardshortcut.cpp b/tizen/src/ui/input/keyboardshortcut.cpp
index c14f2cfdb6..a5f598c8a3 100644
--- a/tizen/src/ui/input/keyboardshortcut.cpp
+++ b/tizen/src/ui/input/keyboardshortcut.cpp
@@ -87,11 +87,10 @@ void KeyboardShortcut::registerHwKeyShortcuts(QList<HardwareKey *> &list)
void KeyboardShortcut::cancelHwKeyShortcuts(QList<HardwareKey *> &list)
{
for (int index = 0; index < list.count(); index++) {
- delete hwKeyShortcutMap.value(list.at(index));
- hwKeyShortcutMap.remove(list.at(index));
+ delete hwKeyShortcutMap.take(list.at(index));
}
- qDebug() << hwKeyShortcutMap.count() << "shortcuts have been registered";
+ qDebug() << hwKeyShortcutMap.count() << "shortcuts have been unregistered";
}
void KeyboardShortcut::slotHwKeyShortcut(int keycode)