From a4ede4e0ebaf0bba57da8fc2924577f1a8ff7b54 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 1 Apr 2012 16:42:46 +0200 Subject: Allow showing Nepomuk metadata inside views Metadata like image-size, rating, comments, tags, ... can be shown now in the view (e.g. as column in the Details mode). Still open: The rating-information needs to be shown as stars. In the context of this feature also the following bugs have been fixed: - Fix visual glitches in the header of the Details mode - Improve the minimum column width calculation to respect also the headling and not only the content BUG: 296782 FIXED-IN: 4.9.0 --- src/kitemviews/kfileitemlistwidget.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/kitemviews/kfileitemlistwidget.h') diff --git a/src/kitemviews/kfileitemlistwidget.h b/src/kitemviews/kfileitemlistwidget.h index 76d090040..d68a22405 100644 --- a/src/kitemviews/kfileitemlistwidget.h +++ b/src/kitemviews/kfileitemlistwidget.h @@ -109,17 +109,11 @@ private slots: void slotCutItemsChanged(); private: - enum TextId { + enum RoleType { Name, Size, Date, - Permissions, - Owner, - Group, - Type, - Destination, - Path, - TextIdCount // Mandatory last entry + Generic // Mandatory last entry }; void triggerCacheRefreshing(); @@ -139,7 +133,7 @@ private: static QPixmap pixmapForIcon(const QString& name, int size); static void applyCutEffect(QPixmap& pixmap); static void applyHiddenEffect(QPixmap& pixmap); - static TextId roleTextId(const QByteArray& role); + static RoleType roleType(const QByteArray& role); /** * @return Shown string for the role \p role of the item with the values \p values. @@ -164,8 +158,13 @@ private: QRectF m_iconRect; // Cache for KItemListWidget::iconRect() QPixmap m_hoverPixmap; // Cache for modified m_pixmap when hovering the item - QPointF m_textPos[TextIdCount]; - QStaticText m_text[TextIdCount]; + struct TextInfo + { + QPointF pos; + QStaticText staticText; + }; + QHash m_textInfo; + QRectF m_textRect; QList m_sortedVisibleRoles; -- cgit v1.3.1