From 5863300f67e1dc043a19201fafdf9e30dbcdcd97 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 11 Feb 2019 17:27:45 -0500 Subject: [PATCH] [partition] Use const QString& - minor code-layout and idiomatic-C++ --- src/modules/partition/core/PartitionLayout.cpp | 6 +++--- src/modules/partition/core/PartitionLayout.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/partition/core/PartitionLayout.cpp b/src/modules/partition/core/PartitionLayout.cpp index f8ff79d2c..4f3225e94 100644 --- a/src/modules/partition/core/PartitionLayout.cpp +++ b/src/modules/partition/core/PartitionLayout.cpp @@ -53,7 +53,7 @@ PartitionLayout::addEntry( PartitionLayout::PartitionEntry entry ) } static double -parseSizeString( QString sizeString, PartitionLayout::SizeUnit *unit ) +parseSizeString( const QString& sizeString, PartitionLayout::SizeUnit* unit ) { double value; bool ok; @@ -103,7 +103,7 @@ parseSizeString( QString sizeString, PartitionLayout::SizeUnit *unit ) } void -PartitionLayout::addEntry( QString mountPoint, QString size, QString min ) +PartitionLayout::addEntry( const QString& mountPoint, const QString& size, const QString& min ) { PartitionLayout::PartitionEntry entry; @@ -119,7 +119,7 @@ PartitionLayout::addEntry( QString mountPoint, QString size, QString min ) } void -PartitionLayout::addEntry( QString label, QString mountPoint, QString fs, QString size, QString min ) +PartitionLayout::addEntry( const QString& label, const QString& mountPoint, const QString& fs, const QString& size, const QString& min ) { PartitionLayout::PartitionEntry entry; diff --git a/src/modules/partition/core/PartitionLayout.h b/src/modules/partition/core/PartitionLayout.h index 8c17c3a9f..65ed1d850 100644 --- a/src/modules/partition/core/PartitionLayout.h +++ b/src/modules/partition/core/PartitionLayout.h @@ -61,8 +61,8 @@ public: ~PartitionLayout(); void addEntry( PartitionEntry entry ); - void addEntry( QString mountPoint, QString size, QString min = "" ); - void addEntry( QString label, QString mountPoint, QString fs, QString size, QString min = "" ); + void addEntry( const QString& mountPoint, const QString& size, const QString& min = QString() ); + void addEntry( const QString& label, const QString& mountPoint, const QString& fs, const QString& size, const QString& min = QString() ); /** * @brief Apply the current partition layout to the selected drive space.