]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kstandarditemlistgroupheader.cpp
Fix selection rect after porting from QFontMetrics::width()
[dolphin.git] / src / kitemviews / kstandarditemlistgroupheader.cpp
index 3a5ddd94430b8c11cc89a5693c1acb5f8af3b076..062b20e905ce02c84fdb9943afa71c71714d1c42 100644 (file)
@@ -1,8 +1,7 @@
 /***************************************************************************
  *   Copyright (C) 2011 by Peter Penz <peter.penz19@gmail.com>             *
  *                                                                         *
- *   Based on the Itemviews NG project from Trolltech Labs:                *
- *   http://qt.gitorious.org/qt-labs/itemviews-ng                          *
+ *   Based on the Itemviews NG project from Trolltech Labs                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -22,7 +21,7 @@
 
 #include "kstandarditemlistgroupheader.h"
 
-#include <kratingpainter.h>
+#include <KRatingPainter>
 #include <QPainter>
 
 KStandardItemListGroupHeader::KStandardItemListGroupHeader(QGraphicsWidget* parent) :
@@ -75,15 +74,15 @@ void KStandardItemListGroupHeader::paintSeparator(QPainter* painter, const QColo
 
 void KStandardItemListGroupHeader::roleChanged(const QByteArray &current, const QByteArray &previous)
 {
-    Q_UNUSED(current);
-    Q_UNUSED(previous);
+    Q_UNUSED(current)
+    Q_UNUSED(previous)
     m_dirtyCache = true;
 }
 
 void KStandardItemListGroupHeader::dataChanged(const QVariant& current, const QVariant& previous)
 {
-    Q_UNUSED(current);
-    Q_UNUSED(previous);
+    Q_UNUSED(current)
+    Q_UNUSED(previous)
     m_dirtyCache = true;
 }
 
@@ -101,7 +100,7 @@ void KStandardItemListGroupHeader::updateCache()
     const qreal maxWidth = size().width() - 4 * styleOption().padding;
 
     if (role() == "rating") {
-        m_text = QString();
+        m_text.setText(QString());
 
         const qreal height = styleOption().fontMetrics.ascent();
         const QSizeF pixmapSize(qMin(height * 5, maxWidth), height);
@@ -122,4 +121,3 @@ void KStandardItemListGroupHeader::updateCache()
     }
 }
 
-#include "kstandarditemlistgroupheader.moc"