From 707ec9855332bdb0b5d7022f99b580c373a9d955 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 9 May 2019 07:58:20 -0400 Subject: [PATCH] [partition] Tidy labels view - Use MiB terminology and support code - Remove debugging chattiness - Fix up include style --- .../partition/gui/PartitionLabelsView.cpp | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/modules/partition/gui/PartitionLabelsView.cpp b/src/modules/partition/gui/PartitionLabelsView.cpp index b5fd0fc91..f47dc41e1 100644 --- a/src/modules/partition/gui/PartitionLabelsView.cpp +++ b/src/modules/partition/gui/PartitionLabelsView.cpp @@ -19,11 +19,12 @@ #include "PartitionLabelsView.h" -#include -#include +#include "core/PartitionModel.h" +#include "core/ColorUtils.h" -#include -#include +#include "utils/CalamaresUtilsGui.h" +#include "utils/Logger.h" +#include "utils/Units.h" #include #include @@ -35,6 +36,7 @@ #include #include +using CalamaresUtils::operator""_MiB; static const int LAYOUT_MARGIN = 4; static const int LABEL_PARTITION_SQUARE_MARGIN = @@ -62,12 +64,6 @@ PartitionLabelsView::PartitionLabelsView( QWidget* parent ) setSelectionBehavior( QAbstractItemView::SelectRows ); setSelectionMode( QAbstractItemView::SingleSelection ); this->setObjectName("partitionLabel"); - // Debug - connect( this, &PartitionLabelsView::clicked, - this, [=]( const QModelIndex& index ) - { - cDebug() << "Clicked row" << index.row(); - } ); setMouseTracking( true ); } @@ -162,8 +158,8 @@ PartitionLabelsView::getIndexesToDraw( const QModelIndex& parent ) const //HACK: horrible special casing follows. // To save vertical space, we choose to hide short instances of free space. - // Arbitrary limit: 10MB. - const qint64 maxHiddenB = 10000000; + // Arbitrary limit: 10MiB. + const qint64 maxHiddenB = 10_MiB; if ( index.data( PartitionModel::IsFreeSpaceRole ).toBool() && index.data( PartitionModel::SizeRole ).toLongLong() < maxHiddenB ) continue;