summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan de Groot <groot@kde.org>2019-05-09 07:58:20 -0400
committerAdriaan de Groot <groot@kde.org>2019-05-09 07:58:20 -0400
commit707ec9855332bdb0b5d7022f99b580c373a9d955 (patch)
treec70638d7f672c4e2cf25be4ddfa1b49e2f8fd739
parent50857dcfec5904781b50cc82e3ad4fc612551635 (diff)
[partition] Tidy labels view
- Use MiB terminology and support code - Remove debugging chattiness - Fix up include style
-rw-r--r--src/modules/partition/gui/PartitionLabelsView.cpp20
1 files 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 <core/PartitionModel.h>
-#include <core/ColorUtils.h>
+#include "core/PartitionModel.h"
+#include "core/ColorUtils.h"
-#include <utils/CalamaresUtilsGui.h>
-#include <utils/Logger.h>
+#include "utils/CalamaresUtilsGui.h"
+#include "utils/Logger.h"
+#include "utils/Units.h"
#include <kpmcore/core/device.h>
#include <kpmcore/fs/filesystem.h>
@@ -35,6 +36,7 @@
#include <QMouseEvent>
#include <QPainter>
+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;