]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphincolumnwidget.cpp
SVN_SILENT made messages (.desktop file)
[dolphin.git] / src / dolphincolumnwidget.cpp
index a51e3ef9fc6f334f167d04011e8f276e98c3aefe..3bb1f36c2104c322fcf31e881073597a32a2dc3a 100644 (file)
@@ -119,7 +119,7 @@ DolphinColumnWidget::DolphinColumnWidget(QWidget* parent,
 
     setModel(m_proxyModel);
     new KMimeTypeResolver(this, m_dolphinModel);
-    m_iconManager = new IconManager(this, m_dolphinModel);
+    m_iconManager = new IconManager(this, m_proxyModel);
     m_iconManager->setShowPreview(m_view->m_controller->dolphinView()->showPreview());
 
     m_dirLister->openUrl(url, KDirLister::NoFlags);
@@ -172,7 +172,6 @@ void DolphinColumnWidget::setShowHiddenFiles(bool show)
 
 void DolphinColumnWidget::setShowPreview(bool show)
 {
-    kDebug() << "-------------- column widget: show" << show;
     m_iconManager->setShowPreview(show);
 
     m_dirLister->stop();
@@ -382,13 +381,8 @@ 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);
-    }
+    if (selectionModel() && selectionModel()->currentIndex().isValid())
+        selectionModel()->setCurrentIndex(selectionModel()->currentIndex(), QItemSelectionModel::SelectCurrent);
 
     updateBackground();
 }
@@ -408,7 +402,9 @@ void DolphinColumnWidget::deactivate()
                    this, SLOT(triggerItem(const QModelIndex&)));
     }
 
+    const QModelIndex current = selectionModel()->currentIndex();
     selectionModel()->clear();
+    selectionModel()->setCurrentIndex(current, QItemSelectionModel::NoUpdate);
     updateBackground();
 }