summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qsoftkeymanager.cpp
diff options
context:
space:
mode:
authorSergio Ahumada <sergio.ahumada@nokia.com>2011-08-26 23:42:57 +0200
committerSergio Ahumada <sergio.ahumada@nokia.com>2011-08-26 23:42:57 +0200
commite028a54690f2fedfae6da19fb24b7401e4a71e56 (patch)
tree72c038e84d9fb1063c970a121949d898442c5648 /src/gui/kernel/qsoftkeymanager.cpp
parentd54407928be05781ede2358baba2f2f91749cc80 (diff)
parent6661f5c2222c145d854e225076195b37672637d2 (diff)
Merge branch 4.7 into qt-4.8-from-4.7
Conflicts: doc/src/index.qdoc src/xmlpatterns/expr/qevaluationcache_p.h
Diffstat (limited to 'src/gui/kernel/qsoftkeymanager.cpp')
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index 9caa37e955..510705f14e 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -123,10 +123,8 @@ QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *act
default:
break;
};
- if (key != 0) {
+ if (key != 0)
QSoftKeyManager::instance()->d_func()->softKeyCommandActions.insert(action, key);
- connect(action, SIGNAL(destroyed(QObject*)), QSoftKeyManager::instance(), SLOT(cleanupHash(QObject*)));
- }
#endif
QAction::SoftKeyRole softKeyRole = QAction::NoSoftKey;
switch (standardKey) {
@@ -159,13 +157,7 @@ QAction *QSoftKeyManager::createKeyedAction(StandardSoftKey standardKey, Qt::Key
QScopedPointer<QAction> action(createAction(standardKey, actionWidget));
connect(action.data(), SIGNAL(triggered()), QSoftKeyManager::instance(), SLOT(sendKeyEvent()));
-
-#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2)
- // Don't connect destroyed slot if is was already connected in createAction
- if (!(QSoftKeyManager::instance()->d_func()->softKeyCommandActions.contains(action.data())))
-#endif
connect(action.data(), SIGNAL(destroyed(QObject*)), QSoftKeyManager::instance(), SLOT(cleanupHash(QObject*)));
-
QSoftKeyManager::instance()->d_func()->keyedActions.insert(action.data(), key);
return action.take();
#endif //QT_NO_ACTION
@@ -174,9 +166,7 @@ QAction *QSoftKeyManager::createKeyedAction(StandardSoftKey standardKey, Qt::Key
void QSoftKeyManager::cleanupHash(QObject *obj)
{
Q_D(QSoftKeyManager);
- // Can't use qobject_cast in destroyed() signal handler as that'll return NULL,
- // so use static_cast instead. Since the pointer is only used as a hash key, it is safe.
- QAction *action = static_cast<QAction *>(obj);
+ QAction *action = qobject_cast<QAction*>(obj);
d->keyedActions.remove(action);
#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2)
d->softKeyCommandActions.remove(action);