┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2006-12-14 19:54:59 +0000
committerPeter Penz <[email protected]>2006-12-14 19:54:59 +0000
commit418cfc1d7420eec3b8624b03e1e8250ba31dc08b (patch)
tree39de55725f2b941f299e928a0cd7ef8090a38119 /src/dolphinview.cpp
parent70782d6bb4d3b02c4c48c38ee2867561a706ed84 (diff)
Support 'select all' and 'invert selection' again.
svn path=/trunk/playground/utils/dolphin/; revision=613698
Diffstat (limited to 'src/dolphinview.cpp')
-rw-r--r--src/dolphinview.cpp52
1 files changed, 15 insertions, 37 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index 2f287f353..1dba37ad5 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -302,12 +302,12 @@ void DolphinView::renameSelectedItems()
void DolphinView::selectAll()
{
- //fileView()->selectAll();
+ selectAll(QItemSelectionModel::Select);
}
void DolphinView::invertSelection()
{
- //fileView()->invertSelection();
+ selectAll(QItemSelectionModel::Toggle);
}
DolphinStatusBar* DolphinView::statusBar() const
@@ -814,23 +814,6 @@ void DolphinView::slotContentsMoving(int x, int y)
}
}
-/*KFileView* DolphinView::fileView() const
-{
- return (m_mode == DetailsView) ? static_cast<KFileView*>(m_iconsView) :
- static_cast<KFileView*>(m_iconsView);
-}*/
-
-Q3ScrollView* DolphinView::scrollView() const
-{
- return 0; //(m_mode == DetailsView) ? static_cast<Q3ScrollView*>(m_iconsView) :
- // static_cast<Q3ScrollView*>(m_iconsView);
-}
-
-ItemEffectsManager* DolphinView::itemEffectsManager() const
-{
- return 0;
-}
-
void DolphinView::startDirLister(const KUrl& url, bool reload)
{
if (!url.isValid()) {
@@ -997,19 +980,6 @@ void DolphinView::slotChangeNameFilter(const QString& nameFilter)
m_dirLister->setNameFilter(adjustedFilter);
m_dirLister->emitChanges();
-
- // TODO: this is a workaround for QIconView: the item position
- // stay as they are by filtering, only an inserting of an item
- // results to an automatic adjusting of the item position. In Qt4/KDE4
- // this workaround should get obsolete due to Interview.
- /*KFileView* view = fileView();
- if (view == m_iconsView) {
- KFileItem* first = view->firstFileItem();
- if (first != 0) {
- view->removeItem(first);
- view->insertItem(first);
- }
- }*/
}
void DolphinView::applyModeToView()
@@ -1028,11 +998,6 @@ void DolphinView::applyModeToView()
m_iconsView->setViewMode(QListView::ListMode);
m_iconsView->setGridSize(QSize(256, 24));
break;
-
- //case PreviewsView:
- // m_iconsView->setViewMode(QListView::IconMode);
- // m_iconsView->setGridSize(QSize(128, 128));
- // break;
}
}
@@ -1048,4 +1013,17 @@ int DolphinView::columnIndex(Sorting sorting) const
return index;
}
+void DolphinView::selectAll(QItemSelectionModel::SelectionFlags flags)
+{
+ QItemSelectionModel* selectionModel = m_iconsView->selectionModel();
+ const QAbstractItemModel* itemModel = selectionModel->model();
+
+ const QModelIndex topLeft = itemModel->index(0, 0);
+ const QModelIndex bottomRight = itemModel->index(itemModel->rowCount() - 1,
+ itemModel->columnCount() - 1);
+
+ QItemSelection selection(topLeft, bottomRight);
+ selectionModel->select(selection, flags);
+}
+
#include "dolphinview.moc"