From 487215f0c459ca38c68619325edac4a2fe42ca4b Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Sat, 14 Nov 2009 15:51:47 +0000 Subject: When navigating back/forward in the DolphinPart inside Konqueror, remember 1. the current item, 2. the scroll position of the view, and 3. the expansion state of the details view. Before 3. can be implemented in Dolphin itself, some changes in KUrlNavigator are required. This fix will be in KDE 4.4. BUG: 193549 BUG: 198073 BUG: 213137 svn path=/trunk/KDE/kdebase/apps/; revision=1049164 --- src/dolphindetailsview.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/dolphindetailsview.h') diff --git a/src/dolphindetailsview.h b/src/dolphindetailsview.h index e0f34d349..f9a795560 100644 --- a/src/dolphindetailsview.h +++ b/src/dolphindetailsview.h @@ -47,6 +47,11 @@ public: DolphinSortFilterProxyModel* model); virtual ~DolphinDetailsView(); + /** + * Returns a set containing the URLs of all expanded items. + */ + QSet expandedUrls() const; + protected: virtual bool event(QEvent* event); virtual QStyleOptionViewItem viewOptions() const; @@ -169,7 +174,23 @@ private slots: */ void setFoldersExpandable(bool expandable); + /** + * These slots update the list of expanded items. + */ + void slotExpanded(const QModelIndex& index); + void slotCollapsed(const QModelIndex& index); + +protected slots: + + virtual void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); + private: + /** + * Removes the URLs corresponding to the children of \a index in the rows + * between \a start and \a end inclusive from the set of expanded URLs. + */ + void removeExpandedIndexes(const QModelIndex& parent, int start, int end); + /** * Updates the size of the decoration dependent on the * icon size of the DetailsModeSettings. The controller @@ -203,6 +224,12 @@ private: ViewExtensionsFactory* m_extensionsFactory; QAction* m_expandableFoldersAction; + // A set containing the URLs of all currently expanded folders. + // We cannot use a QSet because a QModelIndex is not guaranteed to remain valid over time. + // Also a QSet does not work as expected because it is not guaranteed that + // subsequent expand/collapse events of the same file item will yield the same QPersistentModelIndex. + QSet m_expandedUrls; + QFont m_font; QSize m_decorationSize; -- cgit v1.3