diff options
| author | Peter Penz <[email protected]> | 2008-07-26 13:46:58 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2008-07-26 13:46:58 +0000 |
| commit | d337ece6df43337eff338758ace5204937a000b7 (patch) | |
| tree | 4f998b92cef3d8cdc9b20a16117e04dd59c6b278 /src/dolphinview.cpp | |
| parent | 8a51f70377a5133984426b3fa999aee3859cfa5e (diff) | |
Provide a 'int selectedItemsCount() const' interface for performance reasons, so that code which just needs to know whether items have been selected does not need to invoke selectedItems().count(), which is quite expensive.
svn path=/trunk/KDE/kdebase/apps/; revision=838037
Diffstat (limited to 'src/dolphinview.cpp')
| -rw-r--r-- | src/dolphinview.cpp | 11 |
1 files changed, 11 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(); |
