Forgot to modify the code for category selection. Fixed.

svn path=/trunk/KDE/kdebase/apps/; revision=748264
This commit is contained in:
Rafael Fernández López 2007-12-13 23:40:29 +00:00
parent 51b61d7735
commit 2df7bd3475

View file

@ -1059,37 +1059,28 @@ void KCategorizedView::mouseReleaseEvent(QMouseEvent *event)
initialPressPosition.setY(initialPressPosition.y() + verticalOffset()); initialPressPosition.setY(initialPressPosition.y() + verticalOffset());
initialPressPosition.setX(initialPressPosition.x() + horizontalOffset()); initialPressPosition.setX(initialPressPosition.x() + horizontalOffset());
QItemSelection selection;
QItemSelection deselection;
#if 0
if (initialPressPosition == d->initialPressPosition) if (initialPressPosition == d->initialPressPosition)
{ {
foreach(const QString &category, d->categories) foreach(const QString &category, d->categories)
{ {
if (d->categoryVisualRect(category).contains(event->pos())) if (d->categoryVisualRect(category).contains(event->pos()))
{ {
foreach (const QModelIndex &index, d->categoriesIndexes[category]) QItemSelection selection;
QModelIndexList indexList = d->categoriesIndexes[category];
foreach (const QModelIndex &index, indexList)
{ {
QModelIndex selectIndex = index.model()->index(index.row(), 0); QModelIndex selectIndex = index.model()->index(index.row(), 0);
if (/*!d->lastSelection.contains(selectIndex)*/)
{
selection << QItemSelectionRange(selectIndex); selection << QItemSelectionRange(selectIndex);
} }
else
{
deselection << QItemSelectionRange(selectIndex);
}
}
selectionModel()->select(selection, QItemSelectionModel::Select); selectionModel()->select(selection, QItemSelectionModel::SelectCurrent);
selectionModel()->select(deselection, QItemSelectionModel::Deselect);
break; break;
} }
} }
} }
#endif
if (d->hovered.isValid()) if (d->hovered.isValid())
viewport()->update(visualRect(d->hovered)); viewport()->update(visualRect(d->hovered));