From 5b8a817a7328fddbee654721cdb93b560a81f4c5 Mon Sep 17 00:00:00 2001 From: Simon Paul St James Date: Fri, 23 Jan 2009 18:55:08 +0000 Subject: 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 --- src/dolphindetailsview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dolphindetailsview.cpp') diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index acfff6a65..21737c840 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -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; -- cgit v1.3