]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphincolumnwidget.cpp
Use a QActionGroup and save 6 slots (and the duplication of the action names in the...
[dolphin.git] / src / dolphincolumnwidget.cpp
index ab7945ea721099278bbd23a26d6a8c3e9e583a12..fcda0676ab7ce08f2b9b377e45041fe9ae705c3f 100644 (file)
@@ -68,6 +68,7 @@ DolphinColumnWidget::DolphinColumnWidget(QWidget* parent,
     setSelectionMode(QAbstractItemView::ExtendedSelection);
     setDragDropMode(QAbstractItemView::DragDrop);
     setDropIndicatorShown(false);
+    setSelectionRectVisible(true);
 
 // TODO: Remove this check when 4.3.2 is released and KDE requires it... this
 //       check avoids a division by zero happening on versions before 4.3.1.
@@ -115,6 +116,7 @@ DolphinColumnWidget::DolphinColumnWidget(QWidget* parent,
 
     m_proxyModel = new DolphinSortFilterProxyModel(this);
     m_proxyModel->setSourceModel(m_dolphinModel);
+    m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
 
     setModel(m_proxyModel);
     new KMimeTypeResolver(this, m_dolphinModel);
@@ -248,17 +250,8 @@ void DolphinColumnWidget::dragMoveEvent(QDragMoveEvent* event)
     }
     setDirtyRegion(m_dropRect);
 
-    bool destIsDir = false;
-    if (index.isValid()) {
-        const KFileItem item = itemForIndex(index);
-        if (!item.isNull() && item.isDir()) {
-            m_dropRect = visualRect(index);
-            destIsDir = true;
-        }
-    } else { // dropping on viewport
-        destIsDir = true;
-    }
-    if (destIsDir && event->mimeData()->hasUrls()) {
+    if (event->mimeData()->hasUrls()) {
+        // accept url drops, independently from the destination item
         event->acceptProposedAction();
     }
 }
@@ -439,14 +432,6 @@ void DolphinColumnWidget::activate()
                 this, SLOT(triggerItem(const QModelIndex&)));
     }
 
-    if (!m_childUrl.isEmpty()) {
-        // assure that the current index is set on the index that represents
-        // the child URL
-        const QModelIndex dirIndex = m_dolphinModel->indexForUrl(m_childUrl);
-        const QModelIndex proxyIndex = m_proxyModel->mapFromSource(dirIndex);
-        selectionModel()->setCurrentIndex(proxyIndex, QItemSelectionModel::Current);
-    }
-
     updateBackground();
 }