diff options
| author | Peter Penz <[email protected]> | 2011-12-08 11:05:27 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-12-08 11:13:28 +0100 |
| commit | 2827b96d9817252c22ae6f788f4d073303178cea (patch) | |
| tree | 41491b7f49edc715512e42a1beffaf3e40eec0a3 /src/kitemviews/kfileitemmodel.cpp | |
| parent | d5bfe1863cd4c741b7b2a1afcad5cccf159e916b (diff) | |
Fix "show hidden files" issues
Use KFileItemModel instead of KDirLister for toggling the whether
hidden files should be shown. This assures that the signal
KFileItemModel::loadingCompleted() will be emitted.
In the longterm Dolphin should only use the KFileItemModel, so that
the KDirLister instance is used only internally as implementation
detail in KFileItemModel. Although there are only a few cases left
where KDirLister is used instead of KFileItemModel this cleanup
will be postponed to after the 4.8 release...
BUG: 287314
BUG: 288213
FIXED-IN: 4.8.0
Diffstat (limited to 'src/kitemviews/kfileitemmodel.cpp')
| -rw-r--r-- | src/kitemviews/kfileitemmodel.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index c0adce986..8eb47f5ec 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -165,6 +165,24 @@ bool KFileItemModel::sortFoldersFirst() const return m_sortFoldersFirst; } +void KFileItemModel::setShowHiddenFiles(bool show) +{ + KDirLister* dirLister = m_dirLister.data(); + if (dirLister) { + dirLister->setShowingDotFiles(show); + dirLister->emitChanges(); + if (show) { + slotCompleted(); + } + } +} + +bool KFileItemModel::showHiddenFiles() const +{ + const KDirLister* dirLister = m_dirLister.data(); + return dirLister ? dirLister->showingDotFiles() : false; +} + QMimeData* KFileItemModel::createMimeData(const QSet<int>& indexes) const { QMimeData* data = new QMimeData(); |
