┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-06-24 23:38:52 +0000
committerPeter Penz <[email protected]>2008-06-24 23:38:52 +0000
commit65e72704e3cb6ff20cd438c5edbba9999611d61e (patch)
tree804b85cc96ece8ae7819e33613403555bb92e3d9 /src
parentdcf7529688170e1ba00cf743d7420bb35d5af6ec (diff)
remember old setting of the uniformItemSizes property and restore it again (thanks to Rafael for the hint)
CCMAIL: [email protected] svn path=/trunk/KDE/kdebase/apps/; revision=824128
Diffstat (limited to 'src')
-rw-r--r--src/iconmanager.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/iconmanager.cpp b/src/iconmanager.cpp
index 471e69842..ccf15e80c 100644
--- a/src/iconmanager.cpp
+++ b/src/iconmanager.cpp
@@ -53,16 +53,19 @@
* QListView does not invoke QItemDelegate::sizeHint() when the
* uniformItemSize property has been set to true, so this property is
* set before exchanging a block of icons. It is important to reset
- * it to false again before the event loop is entered, otherwise QListView
+ * it again before the event loop is entered, otherwise QListView
* would not get the correct size hints after dispatching the layoutChanged()
* signal.
*/
class LayoutBlocker {
public:
- LayoutBlocker(QAbstractItemView* view) : m_view(0)
+ LayoutBlocker(QAbstractItemView* view) :
+ m_uniformSizes(false),
+ m_view(0)
{
if (view->inherits("QListView")) {
m_view = qobject_cast<QListView*>(view);
+ m_uniformSizes = m_view->uniformItemSizes();
m_view->setUniformItemSizes(true);
}
}
@@ -70,11 +73,12 @@ public:
~LayoutBlocker()
{
if (m_view != 0) {
- m_view->setUniformItemSizes(false);
+ m_view->setUniformItemSizes(m_uniformSizes);
}
}
private:
+ bool m_uniformSizes;
QListView* m_view;
};