]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Third attempt for fixing the layout issue, this time without side effects and only...
authorPeter Penz <peter.penz19@gmail.com>
Sun, 30 Mar 2008 13:19:01 +0000 (13:19 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sun, 30 Mar 2008 13:19:01 +0000 (13:19 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=791824

src/dolphiniconsview.cpp
src/dolphiniconsview.h

index da1784c312f96622a2156c8a4d6f57da4010c4e2..dd83de37ecb383fb9d1c552c21511527a70f86af 100644 (file)
@@ -133,6 +133,18 @@ DolphinIconsView::~DolphinIconsView()
     m_categoryDrawer = 0;
 }
 
+void DolphinIconsView::dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight)
+{
+    KCategorizedView::dataChanged(topLeft, bottomRight);
+
+    KCategorizedSortFilterProxyModel* proxyModel = dynamic_cast<KCategorizedSortFilterProxyModel*>(model());
+    if ((flow() == QListView::LeftToRight) && !proxyModel->isCategorizedModel()) {
+        // bypass a QListView issue that items are not layout correctly if the decoration size of
+        // an index changes
+        scheduleDelayedItemsLayout();
+    }
+}
+
 QStyleOptionViewItem DolphinIconsView::viewOptions() const
 {
     QStyleOptionViewItem viewOptions = KCategorizedView::viewOptions();
index 01aac03f2f52f41dc39ecf32a5345dde76df6069..c912b99f7c4102839d13d51834cf80ce47a1bac9 100644 (file)
@@ -48,6 +48,9 @@ public:
     explicit DolphinIconsView(QWidget* parent, DolphinController* controller);
     virtual ~DolphinIconsView();
 
+protected slots:
+    virtual void dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
+
 protected:
     virtual QStyleOptionViewItem viewOptions() const;
     virtual void contextMenuEvent(QContextMenuEvent* event);