[gparted] Fix cannot format error dialog which always reported the file system as encrypted



commit 32c483c314dd3a7227b237fd0612650bcc2feb8e
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Wed Jan 17 12:22:00 2018 +0000

    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 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/Utils.cc b/src/Utils.cc
index a90b16f..171c8b4 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.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]