QHeaderView - remove some (nearly) unused span functions
authorThorbjørn Lund Martsum <tmartsum@gmail.com>
Tue, 10 Apr 2012 06:22:12 +0000 (08:22 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 10 Apr 2012 23:42:12 +0000 (01:42 +0200)
This removes a couple of functions. Two of them are unused and the
last one has its (now) very simple implementation inlined in the
only caller. The last function was called something with spans and
we would like to get away from using the word 'span' since we no
longer uses spans.

Change-Id: Icef95166289d52bd958400cba70daceb6fa75913
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
src/widgets/itemviews/qheaderview.cpp
src/widgets/itemviews/qheaderview_p.h

index 444e56d..e6376ce 100644 (file)
@@ -3415,10 +3415,9 @@ void QHeaderViewPrivate::setHeaderSectionResizeMode(int visual, QHeaderView::Res
 
 QHeaderView::ResizeMode QHeaderViewPrivate::headerSectionResizeMode(int visual) const
 {
-    int span = sectionSpanIndex(visual);
-    if (span == -1)
+    if (visual < 0 || visual >= sectionItems.count())
         return globalResizeMode;
-    return sectionItems.at(span).resizeMode;
+    return sectionItems.at(visual).resizeMode;
 }
 
 void QHeaderViewPrivate::setGlobalHeaderResizeMode(QHeaderView::ResizeMode mode)
index d6e6ab9..cca81b0 100644 (file)
@@ -314,10 +314,6 @@ public:
     void setDefaultSectionSize(int size);
     void recalcSectionStartPos() const; // not really const
 
-    inline int headerSectionCount() const { // for debugging
-        return sectionItems.count();
-    }
-
     inline int headerLength() const { // for debugging
         int len = 0;
         for (int i = 0; i < sectionItems.count(); ++i)
@@ -325,20 +321,6 @@ public:
         return len;
     }
 
-    inline void removeSpans(const QList<int> &spans) {
-        for (int i = spans.count() - 1; i >= 0; --i) {
-            length -= sectionItems.at(spans.at(i)).size;
-            sectionItems.remove(spans.at(i));
-        }
-    }
-
-    inline int sectionSpanIndex(int visual) const {
-        if (visual < sectionItems.count() && visual >= 0) {
-            return visual;
-        }
-        return -1;
-    }
-
     int headerSectionSize(int visual) const;
     int headerSectionPosition(int visual) const;
     int headerVisualIndexAt(int position) const;