diff --git a/src/detailsviewsettingspage.cpp b/src/detailsviewsettingspage.cpp
index 50f2bac8ae..7ff25179de 100644
--- a/src/detailsviewsettingspage.cpp
+++ b/src/detailsviewsettingspage.cpp
@@ -42,7 +42,8 @@ DetailsViewSettingsPage::DetailsViewSettingsPage(DolphinMainWindow* mainWindow,
m_smallIconSize(0),
m_mediumIconSize(0),
m_largeIconSize(0),
- m_fontRequester(0)
+ m_fontRequester(0),
+ m_expandableFolders(0)
{
const int spacing = KDialog::spacingHint();
const int margin = KDialog::marginHint();
@@ -80,6 +81,9 @@ DetailsViewSettingsPage::DetailsViewSettingsPage(DolphinMainWindow* mainWindow,
textLayout->addWidget(fontLabel);
textLayout->addWidget(m_fontRequester);
+ // create "Expandable Folders" checkbox
+ m_expandableFolders = new QCheckBox(i18nc("@option:check", "Expandable Folders"), this);
+
// Add a dummy widget with no restriction regarding
// a vertical resizing. This assures that the dialog layout
// is not stretched vertically.
@@ -110,6 +114,8 @@ void DetailsViewSettingsPage::applySettings()
settings->setFontSize(font.pointSize());
settings->setItalicFont(font.italic());
settings->setBoldFont(font.bold());
+
+ settings->setExpandableFolders(m_expandableFolders->isChecked());
}
void DetailsViewSettingsPage::restoreDefaults()
@@ -147,6 +153,8 @@ void DetailsViewSettingsPage::loadSettings()
m_fontRequester->setMode(DolphinFontRequester::CustomFont);
m_fontRequester->setCustomFont(font);
}
+
+ m_expandableFolders->setChecked(settings->expandableFolders());
}
#include "detailsviewsettingspage.moc"
diff --git a/src/detailsviewsettingspage.h b/src/detailsviewsettingspage.h
index d06b814cf8..b6622348c5 100644
--- a/src/detailsviewsettingspage.h
+++ b/src/detailsviewsettingspage.h
@@ -58,6 +58,7 @@ private:
QRadioButton* m_mediumIconSize;
QRadioButton* m_largeIconSize;
DolphinFontRequester* m_fontRequester;
+ QCheckBox* m_expandableFolders;
};
#endif
diff --git a/src/dolphin_detailsmodesettings.kcfg b/src/dolphin_detailsmodesettings.kcfg
index ce16a551c6..be62e797a5 100644
--- a/src/dolphin_detailsmodesettings.kcfg
+++ b/src/dolphin_detailsmodesettings.kcfg
@@ -29,5 +29,9 @@
KIconLoader::SizeSmall
+
+
+ false
+
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp
index df5246bedb..63498ed9d2 100644
--- a/src/dolphindetailsview.cpp
+++ b/src/dolphindetailsview.cpp
@@ -54,17 +54,19 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr
m_elasticBandOrigin(),
m_elasticBandDestination()
{
+ const DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
+ Q_ASSERT(settings != 0);
Q_ASSERT(controller != 0);
setAcceptDrops(true);
- setRootIsDecorated(false);
setSortingEnabled(true);
setUniformRowHeights(true);
setSelectionBehavior(SelectItems);
setDragDropMode(QAbstractItemView::DragDrop);
setDropIndicatorShown(false);
setAlternatingRowColors(true);
- setItemsExpandable(false);
+ setRootIsDecorated(settings->expandableFolders());
+ setItemsExpandable(settings->expandableFolders());
setMouseTracking(true);
viewport()->setAttribute(Qt::WA_Hover);
@@ -118,10 +120,6 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr
connect(controller->dolphinView(), SIGNAL(additionalInfoChanged()),
this, SLOT(updateColumnVisibility()));
- // apply the details mode settings to the widget
- const DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
- Q_ASSERT(settings != 0);
-
m_font = QFont(settings->fontFamily(), settings->fontSize());
// TODO: Remove this check when 4.3.2 is released and KDE requires it... this
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index b531c6f55f..5ce9cb6e17 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -227,7 +227,7 @@ void DolphinView::setShowPreview(bool show)
m_iconManager->setShowPreview(show);
emit showPreviewChanged();
- loadDirectory(viewPropsUrl, true);
+ loadDirectory(viewPropsUrl);
}
bool DolphinView::showPreview() const
@@ -248,7 +248,7 @@ void DolphinView::setShowHiddenFiles(bool show)
m_dirLister->setShowingDotFiles(show);
emit showHiddenFilesChanged();
- loadDirectory(viewPropsUrl, true);
+ loadDirectory(viewPropsUrl);
}
bool DolphinView::showHiddenFiles() const
@@ -452,7 +452,7 @@ void DolphinView::setAdditionalInfo(KFileItemDelegate::InformationList info)
if (itemView() != m_detailsView) {
// the details view requires no reloading of the directory, as it maps
// the file item delegate info to its columns internally
- loadDirectory(viewPropsUrl, true);
+ loadDirectory(viewPropsUrl);
}
}
diff --git a/src/iconmanager.cpp b/src/iconmanager.cpp
index 5940c909e4..807b91a9ea 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);