diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-03-15 11:42:20 (GMT) |
---|---|---|
committer | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-03-15 11:42:20 (GMT) |
commit | f9a297d9b2331adab2116210d3c527fae22e336e (patch) | |
tree | 59a3bd712d576efba57db1ede5400ff85f233b52 /src/gui/kernel | |
parent | d919343e91fd5e6771f11cb59d4730ec83ed7381 (diff) | |
download | Qt-f9a297d9b2331adab2116210d3c527fae22e336e.zip Qt-f9a297d9b2331adab2116210d3c527fae22e336e.tar.gz Qt-f9a297d9b2331adab2116210d3c527fae22e336e.tar.bz2 |
Avoid panics in QDesktopWidget on Symbian emulator.
There is usually only one screen on the emulator and it was incorrectly
assumed that ScreenDevice() would return null for a non-existing
screen. It panics instead so the entire call must be skipped.
Reviewed-by: Sami Merila
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qdesktopwidget_s60.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/kernel/qdesktopwidget_s60.cpp b/src/gui/kernel/qdesktopwidget_s60.cpp index c3963f4..62a4d40 100644 --- a/src/gui/kernel/qdesktopwidget_s60.cpp +++ b/src/gui/kernel/qdesktopwidget_s60.cpp @@ -188,12 +188,14 @@ void QDesktopWidgetPrivate::cleanup() void QDesktopWidgetPrivate::init_sys() { #if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS) - CWsScreenDevice *dev = S60->screenDevice(1); - if (dev) { - displayControl = static_cast<MDisplayControl *>( - dev->GetInterface(MDisplayControl::ETypeId)); - if (displayControl) { - displayControl->EnableDisplayChangeEvents(ETrue); + if (S60->screenCount() > 1) { + CWsScreenDevice *dev = S60->screenDevice(1); + if (dev) { + displayControl = static_cast<MDisplayControl *>( + dev->GetInterface(MDisplayControl::ETypeId)); + if (displayControl) { + displayControl->EnableDisplayChangeEvents(ETrue); + } } } #endif |