summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qsoftkeymanager.cpp
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2009-11-02 13:58:52 (GMT)
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2009-11-03 12:14:19 (GMT)
commit6a89291da7e1322ad81c4939cc9d69db01957a4c (patch)
treec64e982a92cc29b8421c9f2e5ea9328e18867625 /src/gui/kernel/qsoftkeymanager.cpp
parent8ffbb2e7bd2ba0b92aef8d7212ddd47bdcc4411e (diff)
downloadQt-6a89291da7e1322ad81c4939cc9d69db01957a4c.zip
Qt-6a89291da7e1322ad81c4939cc9d69db01957a4c.tar.gz
Qt-6a89291da7e1322ad81c4939cc9d69db01957a4c.tar.bz2
Fix for defect introduced by dd48c27f
This change causes some applications to crash due to a null pointer dereference in QSoftKeyManagerPrivate::updateSoftKeys_sys. f3854db6 fixes the crash, but introduces incorrect behaviour: the softkey labels are not updated. To see this: 1. Launch qmediaplayer 2. Open a video clip 3. Video clip starts playing but softkeys still have labels "Open" and "Cancel" Reviewed-by: Janne Anttila
Diffstat (limited to 'src/gui/kernel/qsoftkeymanager.cpp')
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index fac936f..8612e64 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -237,7 +237,10 @@ void QSoftKeyManagerPrivate::updateSoftKeys_sys(const QList<QAction*> &softkeys)
}
}
- Qt::WindowType sourceWindowType = QSoftKeyManagerPrivate::softKeySource->window()->windowType();
+ const Qt::WindowType sourceWindowType = QSoftKeyManagerPrivate::softKeySource
+ ? QSoftKeyManagerPrivate::softKeySource->window()->windowType()
+ : Qt::Widget;
+
if (needsExitButton && sourceWindowType != Qt::Dialog && sourceWindowType != Qt::Popup)
QT_TRAP_THROWING(nativeContainer->SetCommandL(2, EAknSoftkeyExit, qt_QString2TPtrC(QSoftKeyManager::tr("Exit"))));