In rare circumstances (a very narrow viewport is a necessary, but not sufficient, condition) DolphinDetailsView::resizeColumns() is called with an empty model so that sizeHintForColumn(...) returns -1 and so the name column ultimately has width -1. Detect and prevent this.

svn path=/trunk/KDE/kdebase/apps/; revision=915781
This commit is contained in:
Simon Paul St James 2009-01-23 18:55:08 +00:00
parent 5b5f0c9d7e
commit 5b8a817a73

View file

@ -900,7 +900,7 @@ void DolphinDetailsView::resizeColumns()
// reasons the exact necessary width for full visible names is
// only checked for up to 200 items:
const int rowCount = model()->rowCount();
if (rowCount < 200) {
if (rowCount > 0 && rowCount < 200) {
const int nameWidth = sizeHintForColumn(DolphinModel::Name);
if (nameWidth + requiredWidth <= viewport()->width()) {
columnWidth[KDirModel::Name] = viewport()->width() - requiredWidth;