┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphiniconsview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-10-05 21:00:44 +0000
committerPeter Penz <[email protected]>2007-10-05 21:00:44 +0000
commit29402a79bc09945ccd96201cbb42027b4c581a00 (patch)
treead3664f888c37b7f331bf1bb856aa130d2d5d0d6 /src/dolphiniconsview.cpp
parent747731077981775cbaefe928068fea4010b6fdb7 (diff)
Refactored DolphinColumnWidget so that it does not need a hierarchical KDirLister. This simplifies the code a lot and also bypasses the current problems with the KDirLister cache when working on hierarchical directories in parallel. There are some minor regressions which will be fixed, but all in all some improvements are visible already:
- the loading of columns is a lot faster - preview in columns is working - no side effects in combination with the treeview-panel because of caching svn path=/trunk/KDE/kdebase/apps/; revision=721678
Diffstat (limited to 'src/dolphiniconsview.cpp')
-rw-r--r--src/dolphiniconsview.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp
index 6b584612c..042c9a76c 100644
--- a/src/dolphiniconsview.cpp
+++ b/src/dolphiniconsview.cpp
@@ -26,6 +26,7 @@
#include "dolphin_iconsmodesettings.h"
#include <kdialog.h>
+#include <kdirmodel.h>
#include <QAbstractProxyModel>
#include <QApplication>
@@ -58,8 +59,6 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controlle
connect(this, SIGNAL(doubleClicked(const QModelIndex&)),
controller, SLOT(triggerItem(const QModelIndex&)));
}
- connect(this, SIGNAL(entered(const QModelIndex&)),
- controller, SLOT(emitItemEntered(const QModelIndex&)));
connect(this, SIGNAL(viewportEntered()),
controller, SLOT(emitViewportEntered()));
connect(controller, SIGNAL(showPreviewChanged(bool)),
@@ -71,6 +70,9 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controlle
connect(controller, SIGNAL(zoomOut()),
this, SLOT(zoomOut()));
+ connect(this, SIGNAL(entered(const QModelIndex&)),
+ this, SLOT(slotEntered(const QModelIndex&)));
+
// apply the icons mode settings to the widget
const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
Q_ASSERT(settings != 0);
@@ -228,6 +230,16 @@ void DolphinIconsView::keyPressEvent(QKeyEvent* event)
}
}
+void DolphinIconsView::slotEntered(const QModelIndex& index)
+{
+ QAbstractProxyModel* proxyModel = static_cast<QAbstractProxyModel*>(model());
+ KDirModel* dirModel = static_cast<KDirModel*>(proxyModel->sourceModel());
+ const QModelIndex dirIndex = proxyModel->mapToSource(index);
+
+ const KFileItem item = dirModel->itemForIndex(dirIndex);
+ m_controller->emitItemEntered(item);
+}
+
void DolphinIconsView::slotShowPreviewChanged(bool showPreview)
{
updateGridSize(showPreview, m_controller->additionalInfoCount());