]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinfileitemdelegate.cpp
The &-shortcut from another action is not set until the action has been shown at...
[dolphin.git] / src / views / dolphinfileitemdelegate.cpp
index 17447d8cb409f173e843677d0d4573b892dd78a9..609a12b98c316999aa0e8df8fc2fa5d5ca8c4a4a 100644 (file)
 
 #include "dolphinfileitemdelegate.h"
 
-#include <dolphinmodel.h>
+#include "dolphinmodel.h"
 #include <kfileitem.h>
 #include <kicon.h>
 #include <kiconloader.h>
+#include <kstringhandler.h>
 
 #include <QAbstractItemModel>
 #include <QAbstractProxyModel>
@@ -82,7 +83,7 @@ void DolphinFileItemDelegate::paint(QPainter* painter,
 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)) {