From e07468c7840caeff97360edf08826aa38e8d96ae Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Thu, 5 Jun 2014 08:50:52 +0200 Subject: Separate width and height info in the layouting code By separating the width and height info, we can save some unnecessary overhead in terms of memory and CPU cycles, and make the calculation of the height of a row (or the width of a column in Compact View) a bit simpler. To achieve this, this patch extends the concept of "logical rows" (which are actually columns in Compact View) to "logical width" and "logical height" (which is the actual height and width, respectively, in Compact View). The distinction between rows/columns and "logical" rows/columns may be a bit confusing, but the confusion is already in the current code, and I hope that it will be mitigated a bit by prefixing the corresponding variables with "logical". REVIEW: 118454 --- src/kitemviews/kstandarditemlistwidget.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/kitemviews/kstandarditemlistwidget.h') diff --git a/src/kitemviews/kstandarditemlistwidget.h b/src/kitemviews/kstandarditemlistwidget.h index ba426d054..4f7a9136e 100644 --- a/src/kitemviews/kstandarditemlistwidget.h +++ b/src/kitemviews/kstandarditemlistwidget.h @@ -38,7 +38,7 @@ public: KStandardItemListWidgetInformant(); virtual ~KStandardItemListWidgetInformant(); - virtual void calculateItemSizeHints(QVector& sizeHints, const KItemListView* view) const; + virtual void calculateItemSizeHints(QVector& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const; virtual qreal preferredRoleColumnWidth(const QByteArray& role, int index, @@ -73,9 +73,9 @@ protected: */ virtual QFont customizedFontForLinks(const QFont& baseFont) const; - void calculateIconsLayoutItemSizeHints(QVector& sizeHints, const KItemListView* view) const; - void calculateCompactLayoutItemSizeHints(QVector& sizeHints, const KItemListView* view) const; - void calculateDetailsLayoutItemSizeHints(QVector& sizeHints, const KItemListView* view) const; + void calculateIconsLayoutItemSizeHints(QVector& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const; + void calculateCompactLayoutItemSizeHints(QVector& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const; + void calculateDetailsLayoutItemSizeHints(QVector& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const; friend class KStandardItemListWidget; // Accesses roleText() }; -- cgit v1.3.1