From 2827b96d9817252c22ae6f788f4d073303178cea Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Thu, 8 Dec 2011 11:05:27 +0100 Subject: 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 --- src/kitemviews/kfileitemmodel.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/kitemviews/kfileitemmodel.h') 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& 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: -- cgit v1.3