mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
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
This commit is contained in:
parent
8a51f70377
commit
d337ece6df
|
@ -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();
|
||||
|
|
|
@ -218,6 +218,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
|
||||
|
|
Loading…
Reference in a new issue