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/dolphinview.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/dolphinview.h')
| -rw-r--r-- | src/dolphinview.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/dolphinview.h b/src/dolphinview.h index 03154f950..7ee7cd02e 100644 --- a/src/dolphinview.h +++ b/src/dolphinview.h @@ -54,6 +54,7 @@ class KActionCollection; class KDirLister; class KUrl; class ViewProperties; +class DolphinDetailsViewExpander; /** * @short Represents a view for the directory content. @@ -225,6 +226,13 @@ public: */ void setContentsPosition(int x, int y); + /** + * Sets the upper left position of the view content + * to (x,y) after the directory loading is finished. + * This is useful when going back or forward in history. + */ + void setRestoredContentsPosition(const QPoint& pos); + /** Returns the upper left position of the view content. */ QPoint contentsPosition() const; @@ -356,6 +364,17 @@ public: */ bool itemsExpandable() const; + /** + * Restores the view state (current item, contents position, details view expansion state) + */ + void restoreState(QDataStream &stream); + + /** + * Saves the view state (current item, contents position, details view expansion state) + */ + void saveState(QDataStream &stream); + + public slots: /** * Changes the directory to \a url. If the current directory is equal to @@ -669,6 +688,12 @@ private slots: void slotDirListerCompleted(); /** + * Invoked when the loading of the directory is finished. + * Restores the active item and the scroll position if possible. + */ + void slotLoadingCompleted(); + + /** * Is invoked when the KDirLister indicates refreshed items. */ void slotRefreshItems(); @@ -699,6 +724,11 @@ private slots: */ void slotRedirection(const KUrl& oldUrl, const KUrl& newUrl); + /** + * Restores the contents position, if history information about the old position is available. + */ + void restoreContentsPosition(); + private: void loadDirectory(const KUrl& url, bool reload = false); @@ -784,6 +814,8 @@ private: bool supportsCategorizedSorting() const; bool itemsExpandable() const; + QSet<KUrl> expandedUrls() const; + const DolphinDetailsViewExpander* setExpandedUrls(const QSet<KUrl>& urlsToExpand); /** * Returns true, if a reloading of the items is required @@ -802,6 +834,7 @@ private: DolphinColumnViewContainer* m_columnsContainer; DolphinSortFilterProxyModel* m_proxyModel; QAbstractItemView* m_dragSource; + QPointer<DolphinDetailsViewExpander> m_detailsViewExpander; }; bool m_active : 1; @@ -812,6 +845,7 @@ private: bool m_isContextMenuOpen : 1; // TODO: workaround for Qt-issue 207192 bool m_ignoreViewProperties : 1; bool m_assureVisibleCurrentIndex : 1; + bool m_expanderActive : 1; Mode m_mode; @@ -826,6 +860,7 @@ private: KUrl m_rootUrl; KUrl m_activeItemUrl; + QPoint m_restoredContentsPosition; KUrl m_createdItemUrl; // URL for a new item that got created by the "Create New..." menu KFileItemList m_selectedItems; // this is used for making the View to remember selections after F5 |
