]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinfileitemdelegate.cpp
* Use Nepomuk for getting the meta data instead of KFileMetaInfo.
[dolphin.git] / src / dolphinfileitemdelegate.cpp
index c0e032570ce78f228edc6af26ffd30f03b4917fc..3fa05cbb5f808f2e9c64e1328440454bab34d2eb 100644 (file)
@@ -42,13 +42,13 @@ void DolphinFileItemDelegate::paint(QPainter* painter,
 {
     if (m_hasMinimizedNameColumn && (index.column() == KDirModel::Name)) {
         QStyleOptionViewItemV4 opt(option);
-        
+
         const QAbstractProxyModel* proxyModel = static_cast<const QAbstractProxyModel*>(index.model());
         const KDirModel* dirModel = static_cast<const KDirModel*>(proxyModel->sourceModel());
         const QModelIndex dirIndex = proxyModel->mapToSource(index);
         const KFileItem item = dirModel->itemForIndex(dirIndex);
         if (!item.isNull()) {
-            const int width = nameColumnWidth(item.name(), opt);
+            const int width = nameColumnWidth(item.text(), opt);
             opt.rect.setWidth(width);
         }
         KFileItemDelegate::paint(painter, opt, index);
@@ -61,7 +61,7 @@ int DolphinFileItemDelegate::nameColumnWidth(const QString& name, const QStyleOp
 {
     QFontMetrics fontMetrics(option.font);
     int width = option.decorationSize.width() + fontMetrics.width(name) + 16;
-    
+
     const int defaultWidth = option.rect.width();
     if ((defaultWidth > 0) && (defaultWidth < width)) {
         width = defaultWidth;
@@ -69,4 +69,3 @@ int DolphinFileItemDelegate::nameColumnWidth(const QString& name, const QStyleOp
     return width;
 }
 
-#include "dolphinfileitemdelegate.moc"