aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <ppenz@openismus.com>2010-06-25 09:24:48 +0200
committerJörgen Scheibengruber <jorgen.scheibengruber@nokia.com>2010-06-29 16:09:52 +0300
commit88ec0b257bd1edfe95dbe8b3daa16936495fe995 (patch)
tree69776a39fbf20363ff4d157f00a1fba20db2dda8
parent69d3b517705bda603e0ce039f8fb8129a7f8029b (diff)
Changes: Improve performance of MStyleContainer::currentStyle()
RevBy: Armin, Jörgen Details: When panning through a list, MStyleContainer::currentStyle() is invoked several thousands of times. With this small patch panning the list of the widgetsgallery in the portrait mode gets faster by around 1 fps. The patch is related to NB#174717, but probably further investigations need to be done to speedup the performance.
-rw-r--r--src/corelib/style/mstyle.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/style/mstyle.cpp b/src/corelib/style/mstyle.cpp
index bfa28719..22fe39bf 100644
--- a/src/corelib/style/mstyle.cpp
+++ b/src/corelib/style/mstyle.cpp
@@ -200,8 +200,9 @@ const MStyle *MStyleContainer::currentStyle() const
{
M::Orientation orientation = M::Landscape;
- if (MApplication::activeWindow())
- orientation = MApplication::activeWindow()->orientation();
+ const MWindow *activeWindow = MApplication::activeWindow();
+ if (activeWindow)
+ orientation = activeWindow->orientation();
if (d_ptr->cachedCurrentStyle[orientation] != 0) {
return d_ptr->cachedCurrentStyle[orientation];