From 32c483c314dd3a7227b237fd0612650bcc2feb8e Mon Sep 17 00:00:00 2001 From: Mike Fleetwood Date: Wed, 17 Jan 2018 12:22:00 +0000 Subject: [PATCH] Fix cannot format error dialog which always reported the file system as encrypted Try to format an existing partition with a file system which doesn't fit. The error dialog reporting the partition as too small or too large always claimed the file system was encrypted, whether it was or not. For example trying to format a 128 MiB partition as btrfs produces this error dialog: (-) Cannot format this file system to [Encrypted] btrfs A [Encrypted] btrfs file system requires a partition of at least 256.00 MiB. [ OK ] This commit: 88136c96d7dd8576963c2e62eb2e9c85f5bff026 Extend functions generating encrypted file system string (#774818) just completely missed handling the case for non-encrypted file systems in Utils::get_filesystem_string(). Add the missed code. --- src/Utils.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Utils.cc b/src/Utils.cc index a90b16fd..171c8b43 100644 --- a/src/Utils.cc +++ b/src/Utils.cc @@ -316,7 +316,10 @@ const Glib::ustring Utils::get_encrypted_string() const Glib::ustring Utils::get_filesystem_string( bool encrypted, FILESYSTEM fstype ) { - return get_encrypted_string() + " " + get_filesystem_string( fstype ); + if ( encrypted ) + return get_encrypted_string() + " " + get_filesystem_string( fstype ); + else + return get_filesystem_string( fstype ); } // Return Linux kernel name only for mountable file systems.