file name in DolphinFileItemDelegate. This makes sure that zero width
spaces (which prevent kerning) are added at the same places where
KFileItemDelegate adds them when actually rendering the name. Fixes
the problem that file names are elided and partly replaced by "..."
even though there is enough space for the full name.
CCBUG: 251121
svn path=/trunk/KDE/kdebase/apps/; revision=
1179568
#include <kfileitem.h>
#include <kicon.h>
#include <kiconloader.h>
+#include <kstringhandler.h>
#include <QAbstractItemModel>
#include <QAbstractProxyModel>
int DolphinFileItemDelegate::nameColumnWidth(const QString& name, const QStyleOptionViewItem& option)
{
QFontMetrics fontMetrics(option.font);
- int width = option.decorationSize.width() + fontMetrics.width(name) + 16;
+ int width = option.decorationSize.width() + fontMetrics.width(KStringHandler::preProcessWrap(name)) + 16;
const int defaultWidth = option.rect.width();
if ((defaultWidth > 0) && (defaultWidth < width)) {