┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/iconmanager.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-02-16 13:16:59 +0000
committerPeter Penz <[email protected]>2008-02-16 13:16:59 +0000
commit67f36d71e78c2c64500229150d262b621f69fe54 (patch)
treebb62c026be3e51648347411be9aa03b2bf3e70f9 /src/iconmanager.cpp
parent0706655eab026b9ab328e1b56292655281ad0596 (diff)
Provide an option for the details view to expand folders (= tree view), as this is required for Konqueror to get back this functionality from KDE 3. It is possible in Dolphin to enable this option too, but it is set to false per default.
BUG: 155571 svn path=/trunk/KDE/kdebase/apps/; revision=775621
Diffstat (limited to 'src/iconmanager.cpp')
-rw-r--r--src/iconmanager.cpp29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/iconmanager.cpp b/src/iconmanager.cpp
index 5940c909e..807b91a9e 100644
--- a/src/iconmanager.cpp
+++ b/src/iconmanager.cpp
@@ -116,11 +116,24 @@ void IconManager::updateIcons(const KFileItemList& items)
void IconManager::replaceIcon(const KFileItem& item, const QPixmap& pixmap)
{
Q_ASSERT(!item.isNull());
+ if (!m_showPreview) {
+ // the preview has been canceled in the meantime
+ return;
+ }
+
+ // check whether the item is part of the directory lister (it is possible
+ // that a preview from an old directory lister is received)
KDirLister* dirLister = m_dolphinModel->dirLister();
- if (!m_showPreview || (item.url().directory() != dirLister->url().path())) {
- // the preview has been canceled in the meanwhile or the preview
- // job is still working on items of an older URL, hence
- // the item is not part of the directory model anymore
+ bool isOldPreview = true;
+ const KUrl::List dirs = dirLister->directories();
+ const QString itemDir = item.url().directory();
+ foreach (KUrl url, dirs) {
+ if (url.path() == itemDir) {
+ isOldPreview = false;
+ break;
+ }
+ }
+ if (isOldPreview) {
return;
}
@@ -192,7 +205,13 @@ void IconManager::applyCutItemEffect()
return;
}
- const KFileItemList items(m_dolphinModel->dirLister()->items());
+ KFileItemList items;
+ KDirLister* dirLister = m_dolphinModel->dirLister();
+ const KUrl::List dirs = dirLister->directories();
+ foreach (KUrl url, dirs) {
+ items << dirLister->itemsForDir(url);
+ }
+
foreach (KFileItem item, items) {
if (isCutItem(item)) {
const QModelIndex index = m_dolphinModel->indexForItem(item);