class KDirLister;
class KUrl;
class ViewProperties;
+class DolphinDetailsViewExpander;
/**
* @short Represents a view for the directory content.
*/
bool supportsCategorizedSorting() const;
- /**
- * Selects all items.
- * @see DolphinView::selectedItems()
- */
- void selectAll();
-
- /**
- * Inverts the current selection: selected items get unselected,
- * unselected items get selected.
- * @see DolphinView::selectedItems()
- */
- void invertSelection();
-
- /** Returns true, if at least one item is selected. */
- bool hasSelection() const;
-
- void clearSelection();
-
/**
* Returns the selected items. The list is empty if no item has been
* selected.
*/
int selectedItemsCount() const;
+ QItemSelectionModel* selectionModel() const;
+
/**
* Sets the upper left position of the view content
* to (x,y). The content of the view might be larger than the visible area
*/
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;
*/
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
*/
void setUrl(const KUrl& url);
+ /**
+ * Selects all items.
+ * @see DolphinView::selectedItems()
+ */
+ void selectAll();
+
+ /**
+ * Inverts the current selection: selected items get unselected,
+ * unselected items get selected.
+ * @see DolphinView::selectedItems()
+ */
+ void invertSelection();
+
+ /** Returns true, if at least one item is selected. */
+ bool hasSelection() const;
+
+ void clearSelection();
+
/**
* Request of a selection change. The view will do its best to accommodate
* the request, but it is not guaranteed that all items in \a selection
/**
* Copies all selected items to the clipboard and marks
- * the items as cutted.
+ * the items as cut.
*/
void cutSelectedItems();
protected:
/** @see QWidget::mouseReleaseEvent */
virtual void mouseReleaseEvent(QMouseEvent* event);
- virtual void wheelEvent(QWheelEvent* event);
virtual bool eventFilter(QObject* watched, QEvent* event);
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 restoreSelection();
+ /**
+ * Called when a redirection happens.
+ * Testcase: fish://localhost
+ */
+ 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);
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
DolphinColumnViewContainer* m_columnsContainer;
DolphinSortFilterProxyModel* m_proxyModel;
QAbstractItemView* m_dragSource;
+ QPointer<DolphinDetailsViewExpander> m_detailsViewExpander;
};
bool m_active : 1;
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;
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