diff options
author | Andrew <forkk@forkk.net> | 2013-12-01 14:28:47 -0600 |
---|---|---|
committer | Andrew <forkk@forkk.net> | 2013-12-01 14:28:47 -0600 |
commit | 613699b3626aea750093ab7eaaeccaa28c0e87c6 (patch) | |
tree | 7fd542b8f4be10359ba2aaeac9834f1b5c86a750 /depends/groupview | |
parent | 2427ad687137bbcfc7303a931d7e0b74d5325e48 (diff) | |
parent | 75c4d97b90e39f2bda6e682def0fdda044cbcf6f (diff) | |
download | MultiMC-613699b3626aea750093ab7eaaeccaa28c0e87c6.tar MultiMC-613699b3626aea750093ab7eaaeccaa28c0e87c6.tar.gz MultiMC-613699b3626aea750093ab7eaaeccaa28c0e87c6.tar.lz MultiMC-613699b3626aea750093ab7eaaeccaa28c0e87c6.tar.xz MultiMC-613699b3626aea750093ab7eaaeccaa28c0e87c6.zip |
Merge branch 'develop' of github.com:MultiMC/MultiMC5 into develop
Diffstat (limited to 'depends/groupview')
-rw-r--r-- | depends/groupview/src/categorizedview.cpp | 29 | ||||
-rw-r--r-- | depends/groupview/src/categorizedview_p.h | 17 | ||||
-rw-r--r-- | depends/groupview/src/categorydrawer.cpp | 2 |
3 files changed, 14 insertions, 34 deletions
diff --git a/depends/groupview/src/categorizedview.cpp b/depends/groupview/src/categorizedview.cpp index f4449949..1345205c 100644 --- a/depends/groupview/src/categorizedview.cpp +++ b/depends/groupview/src/categorizedview.cpp @@ -58,18 +58,6 @@ struct KCategorizedView::Private::Item struct KCategorizedView::Private::Block { - Block() - : topLeft ( QPoint() ) - , height ( -1 ) - , firstIndex ( QModelIndex() ) - , quarantineStart ( QModelIndex() ) - , items ( QList<Item>() ) - , outOfQuarantine ( false ) - , alternate ( false ) - , collapsed ( false ) - { - } - bool operator!= ( const Block &rhs ) const { return firstIndex != rhs.firstIndex; @@ -83,7 +71,7 @@ struct KCategorizedView::Private::Block } QPoint topLeft; - int height; + int height = -1; QPersistentModelIndex firstIndex; // if we have n elements on this block, and we inserted an element at position i. The quarantine // will start at index (i, column, parent). This means that for all elements j where i <= j <= n, the @@ -97,25 +85,16 @@ struct KCategorizedView::Private::Block // this affects the whole block, not items separately. items contain the topLeft point relative // to the block. Because of insertions or removals a whole block can be moved, so the whole block // will enter in quarantine, what is faster than moving all items in absolute terms. - bool outOfQuarantine; + bool outOfQuarantine = false; // should we alternate its color ? is just a hint, could not be used - bool alternate; - bool collapsed; + bool alternate = false; + bool collapsed = false; }; KCategorizedView::Private::Private ( KCategorizedView *q ) : q ( q ) - , proxyModel ( 0 ) - , categoryDrawer ( 0 ) - , categorySpacing ( 5 ) - , alternatingBlockColors ( false ) - , collapsibleBlocks ( false ) , hoveredBlock ( new Block() ) - , hoveredIndex ( QModelIndex() ) - , pressedPosition ( QPoint() ) - , rubberBandRect ( QRect() ) - , constantItemWidth( 0 ) { } diff --git a/depends/groupview/src/categorizedview_p.h b/depends/groupview/src/categorizedview_p.h index 13809312..524bba3a 100644 --- a/depends/groupview/src/categorizedview_p.h +++ b/depends/groupview/src/categorizedview_p.h @@ -137,14 +137,15 @@ public: */ void _k_slotCollapseOrExpandClicked(QModelIndex); - KCategorizedView *q; - KCategorizedSortFilterProxyModel *proxyModel; - KCategoryDrawer *categoryDrawer; - int categorySpacing; - bool alternatingBlockColors; - bool collapsibleBlocks; - bool constantItemWidth; - + KCategorizedView *q = nullptr; + KCategorizedSortFilterProxyModel *proxyModel = nullptr; + KCategoryDrawer *categoryDrawer = nullptr; + int categorySpacing = 5; + bool alternatingBlockColors = false; + bool collapsibleBlocks = false; + bool constantItemWidth = false; + + // FIXME: this is some really weird logic. Investigate. Block *hoveredBlock; QString hoveredCategory; QModelIndex hoveredIndex; diff --git a/depends/groupview/src/categorydrawer.cpp b/depends/groupview/src/categorydrawer.cpp index 04903206..214ce3b2 100644 --- a/depends/groupview/src/categorydrawer.cpp +++ b/depends/groupview/src/categorydrawer.cpp @@ -42,9 +42,9 @@ public: ~Private() { } + KCategorizedView *view; int leftMargin; int rightMargin; - KCategorizedView *view; }; KCategoryDrawer::KCategoryDrawer(KCategorizedView *view) |