]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphiniconsview.cpp
don't start the editor for renaming the files when double clicking on items
[dolphin.git] / src / dolphiniconsview.cpp
index da1784c312f96622a2156c8a4d6f57da4010c4e2..959f152f0dbec6522781a3c4b2a2f966e15389a8 100644 (file)
@@ -55,6 +55,7 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controlle
     setSpacing(KDialog::spacingHint());
     setMovement(QListView::Static);
     setDragEnabled(true);
+    setEditTriggers(QAbstractItemView::NoEditTriggers);
     viewport()->setAcceptDrops(true);
 
     setMouseTracking(true);
@@ -133,6 +134,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();