mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
Fix crash when category view is enabled if there are no categories in KCategorizedView::moveCursor()
svn path=/trunk/KDE/kdebase/apps/; revision=692073
This commit is contained in:
parent
7efea42cea
commit
4661ece594
1 changed files with 9 additions and 5 deletions
|
@ -1000,8 +1000,11 @@ void KCategorizedView::dragLeaveEvent(QDragLeaveEvent *event)
|
|||
QModelIndex KCategorizedView::moveCursor(CursorAction cursorAction,
|
||||
Qt::KeyboardModifiers modifiers)
|
||||
{
|
||||
if ((viewMode() != KCategorizedView::IconMode) || !d->proxyModel ||
|
||||
!d->itemCategorizer)
|
||||
if ( (viewMode() != KCategorizedView::IconMode) ||
|
||||
!d->proxyModel ||
|
||||
!d->itemCategorizer ||
|
||||
d->categories.isEmpty()
|
||||
)
|
||||
{
|
||||
return QListView::moveCursor(cursorAction, modifiers);
|
||||
}
|
||||
|
@ -1023,9 +1026,10 @@ QModelIndex KCategorizedView::moveCursor(CursorAction cursorAction,
|
|||
int itemWidthPlusSeparation = spacing() + itemWidth;
|
||||
int elementsPerRow = viewportWidth / itemWidthPlusSeparation;
|
||||
|
||||
QString lastCategory = d->categories[0];
|
||||
QString theCategory = d->categories[0];
|
||||
QString afterCategory = d->categories[0];
|
||||
QString lastCategory = d->categories.first();
|
||||
QString theCategory = d->categories.first();
|
||||
QString afterCategory = d->categories.first();
|
||||
|
||||
bool hasToBreak = false;
|
||||
foreach (const QString &category, d->categories)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue