diff options
| author | Frank Reininghaus <[email protected]> | 2009-11-14 15:51:47 +0000 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2009-11-14 15:51:47 +0000 |
| commit | 487215f0c459ca38c68619325edac4a2fe42ca4b (patch) | |
| tree | 15ab897d8696f0093dbe93319cb434a6fa20088c /src/dolphindetailsview.h | |
| parent | d49bdf8f9c7b8b2445e4355c955763ddf6339c19 (diff) | |
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
Diffstat (limited to 'src/dolphindetailsview.h')
| -rw-r--r-- | src/dolphindetailsview.h | 27 |
1 files changed, 27 insertions, 0 deletions
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<KUrl> expandedUrls() const; + protected: virtual bool event(QEvent* event); virtual QStyleOptionViewItem viewOptions() const; @@ -169,8 +174,24 @@ 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 * will get informed about possible zoom in/zoom out @@ -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<QModelIndex> because a QModelIndex is not guaranteed to remain valid over time. + // Also a QSet<QPersistentModelIndex> 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<KUrl> m_expandedUrls; + QFont m_font; QSize m_decorationSize; |
