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.h | |
| 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.h')
| -rw-r--r-- | src/kitemviews/kfileitemmodel.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/kitemviews/kfileitemmodel.h b/src/kitemviews/kfileitemmodel.h index 5d0aa4203..36ed37ba6 100644 --- a/src/kitemviews/kfileitemmodel.h +++ b/src/kitemviews/kfileitemmodel.h @@ -41,6 +41,15 @@ class QTimer; * * Also the recursive expansion of sub-directories is supported by * KFileItemModel::setExpanded(). + * + * TODO: In the longterm instead of passing a KDirLister just an URL should + * be passed and a KDirLister used internally. This solves the following issues: + * - The user of the API does not need to decide whether he listens to KDirLister + * or KFileItemModel. + * - It resolves minor conceptual differences between KDirLister and KFileItemModel. + * E.g. there is no way for KFileItemModel to check whether a completed() signal + * will be emitted after newItems() will be send by KDirLister or not (in the case + * of setShowingDotFiles() no completed() signal will get emitted). */ class LIBDOLPHINPRIVATE_EXPORT KFileItemModel : public KItemModelBase { @@ -60,6 +69,9 @@ public: void setSortFoldersFirst(bool foldersFirst); bool sortFoldersFirst() const; + void setShowHiddenFiles(bool show); + bool showHiddenFiles() const; + /** @reimp */ virtual QMimeData* createMimeData(const QSet<int>& indexes) const; @@ -138,6 +150,13 @@ public: QString nameFilter() const; signals: + /** + * Is emitted after the loading of a directory has been completed or new + * items have been inserted to an already loaded directory. Usually + * one or more itemsInserted() signals are emitted before loadingCompleted() + * (the only exception is loading an empty directory, where only a + * loadingCompleted() signal gets emitted). + */ void loadingCompleted(); protected: |
