Fix broken navigation in tabbox if a tabular layout is used and there is an odd number of items.

svn path=/trunk/KDE/kdebase/workspace/; revision=1042344
This commit is contained in:
Martin Gräßlin 2009-10-29 17:02:54 +00:00
parent 8ebbebbb55
commit f538de9b1d

View file

@ -503,6 +503,8 @@ QModelIndex TabBoxHandler::nextPrev( bool forward ) const
row = 0;
}
ret = model->index( row, column );
if( !ret.isValid() )
ret = model->index( 0, 0 );
}
else
{
@ -516,6 +518,16 @@ QModelIndex TabBoxHandler::nextPrev( bool forward ) const
row = model->rowCount() - 1;
}
ret = model->index( row, column );
if( !ret.isValid() )
{
row = model->rowCount() - 1;
for( int i = model->columnCount() - 1; i >= 0; i-- )
{
ret = model->index( row, i );
if( ret.isValid() )
break;
}
}
}
if( ret.isValid() )
return ret;