KDE/kdelibs/kfile

Rafael Fernández López ereslibre at kde.org
Fri Dec 7 08:11:48 GMT 2007


SVN commit 745896 by ereslibre:

Don't "cache" the palette at the beginning. The color scheme can change while the dialog is opened, and the view should be adapted to that change.

CCMAIL: kde-core-devel at kde.org
CCMAIL: peter.penz at gmx.at


 M  +8 -11     kdiroperator.cpp  


--- trunk/KDE/kdelibs/kfile/kdiroperator.cpp #745895:745896
@@ -92,9 +92,6 @@
     virtual QStyleOptionViewItem viewOptions() const;
     virtual void dragEnterEvent(QDragEnterEvent* event);
     virtual void mousePressEvent(QMouseEvent *event);
-
-private:
-    QStyleOptionViewItem m_viewOptions;
 };
 
 KDirOperatorIconView::KDirOperatorIconView(QWidget *parent) :
@@ -109,13 +106,7 @@
     setVerticalScrollMode(QListView::ScrollPerPixel);
     setHorizontalScrollMode(QListView::ScrollPerPixel);
 
-    m_viewOptions = QListView::viewOptions();
-    m_viewOptions.showDecorationSelected = true;
-    m_viewOptions.decorationPosition = QStyleOptionViewItem::Left;
-    m_viewOptions.displayAlignment = Qt::AlignLeft | Qt::AlignVCenter;
-    m_viewOptions.decorationSize = QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall);
-
-    QFontMetrics metrics(m_viewOptions.font);
+    QFontMetrics metrics(viewOptions().font);
     const int fontHeight = metrics.height();
     setGridSize(QSize(fontHeight * 10, fontHeight + 4));
 }
@@ -126,7 +117,13 @@
 
 QStyleOptionViewItem KDirOperatorIconView::viewOptions() const
 {
-    return m_viewOptions;
+    QStyleOptionViewItem viewOptions = QListView::viewOptions();
+    viewOptions.showDecorationSelected = true;
+    viewOptions.decorationPosition = QStyleOptionViewItem::Left;
+    viewOptions.displayAlignment = Qt::AlignLeft | Qt::AlignVCenter;
+    viewOptions.decorationSize = QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall);
+
+    return viewOptions;
 }
 
 void KDirOperatorIconView::dragEnterEvent(QDragEnterEvent* event)




More information about the kde-core-devel mailing list