diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphinview.cpp | 11 | ||||
| -rw-r--r-- | src/dolphinview.h | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 0b04d0afa..97bce5aac 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -329,6 +329,17 @@ KUrl::List DolphinView::selectedUrls() const return urls; } +int DolphinView::selectedItemsCount() const +{ + if (isColumnViewActive()) { + // TODO: get rid of this special case by adjusting the dir lister + // to the current column + return m_columnView->selectedItems().count(); + } + + return itemView()->selectionModel()->selection().count(); +} + void DolphinView::setContentsPosition(int x, int y) { QAbstractItemView* view = itemView(); diff --git a/src/dolphinview.h b/src/dolphinview.h index 6f4327c52..e74975f67 100644 --- a/src/dolphinview.h +++ b/src/dolphinview.h @@ -219,6 +219,12 @@ public: KUrl::List selectedUrls() const; /** + * Returns the number of selected items (this is faster than + * invoking selectedItems().count()). + */ + int selectedItemsCount() 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 * and hence a scrolling must be done. |
