summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2010-02-04 09:53:05 (GMT)
committerJason Barron <jbarron@trolltech.com>2010-02-04 14:10:46 (GMT)
commit56d1da45bc15989542fe3621c9c9de444219729c (patch)
tree76b309a829027aff9bf59cf92d3863b012c7e07d /src
parent94abb3ee93aa09f79640e14fed89b286c57ce05c (diff)
downloadQt-56d1da45bc15989542fe3621c9c9de444219729c.zip
Qt-56d1da45bc15989542fe3621c9c9de444219729c.tar.gz
Qt-56d1da45bc15989542fe3621c9c9de444219729c.tar.bz2
Fix crash when multiple screens are reported from HAL.
The support for multiple screens is not implemented yet in Qt on the Symbian platform, so there is really no need to query the HAL for the value since the additional screens can't be used yet anyway. The crash here occured when the HAL returned more than 1 screen, but the arrays were resized to contain one element. The loop in resizeEvent() was iterating past the end of the array because it thought there were more screens than the arrays did. Reviewed-by: axis
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qdesktopwidget_s60.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/gui/kernel/qdesktopwidget_s60.cpp b/src/gui/kernel/qdesktopwidget_s60.cpp
index 77745ea..84e3c5d 100644
--- a/src/gui/kernel/qdesktopwidget_s60.cpp
+++ b/src/gui/kernel/qdesktopwidget_s60.cpp
@@ -88,24 +88,20 @@ QDesktopWidgetPrivate::~QDesktopWidgetPrivate()
void QDesktopWidgetPrivate::init(QDesktopWidget *that)
{
- int screenCount=0;
+// int screenCount=0;
- if (HAL::Get(0, HALData::EDisplayNumberOfScreens, screenCount) == KErrNone)
- QDesktopWidgetPrivate::screenCount = screenCount;
- else
- QDesktopWidgetPrivate::screenCount = 0;
+ // ### TODO: Implement proper multi-display support
+ QDesktopWidgetPrivate::screenCount = 1;
+// if (HAL::Get(0, HALData::EDisplayNumberOfScreens, screenCount) == KErrNone)
+// QDesktopWidgetPrivate::screenCount = screenCount;
+// else
+// QDesktopWidgetPrivate::screenCount = 0;
rects = new QVector<QRect>();
workrects = new QVector<QRect>();
rects->resize(QDesktopWidgetPrivate::screenCount);
workrects->resize(QDesktopWidgetPrivate::screenCount);
-
- // ### TODO: Implement proper multi-display support
- rects->resize(1);
- rects->replace(0, that->rect());
- workrects->resize(1);
- workrects->replace(0, that->rect());
}
void QDesktopWidgetPrivate::cleanup()