From 9424f5a789b98b148e3c6b39738da164c73e0431 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Sat, 17 Sep 2011 14:35:25 +0200 Subject: Implement restoring expanded folders in Details View --- src/kitemviews/kfileitemmodel.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/kitemviews/kfileitemmodel.h') diff --git a/src/kitemviews/kfileitemmodel.h b/src/kitemviews/kfileitemmodel.h index 160817043..4156b2be8 100644 --- a/src/kitemviews/kfileitemmodel.h +++ b/src/kitemviews/kfileitemmodel.h @@ -113,6 +113,11 @@ public: bool setExpanded(int index, bool expanded); bool isExpanded(int index) const; bool isExpandable(int index) const; + QSet expandedUrls() const; + void restoreExpandedUrls(const QSet& urls); + +signals: + void loadingCompleted(); protected: virtual void onGroupRoleChanged(const QByteArray& current, const QByteArray& previous); @@ -199,12 +204,19 @@ private: QTimer* m_minimumUpdateIntervalTimer; QTimer* m_maximumUpdateIntervalTimer; KFileItemList m_pendingItemsToInsert; + bool m_pendingEmitLoadingCompleted; // Stores the smallest expansion level of the root-URL. Is required to calculate // the "expansionLevel" role in an efficient way. A value < 0 indicates that // it has not been initialized yet. mutable int m_rootExpansionLevel; + // Stores the URLs of the expanded folders. + QSet m_expandedUrls; + + // Stores the URLs which have to be expanded in order to restore a previous state of the model. + QSet m_restoredExpandedUrls; + friend class KFileItemModelTest; // For unit testing }; -- cgit v1.3.1