Rename udf member variable to m_old_mkudffs

To make it clear m_old_mkudffs is a member variable.  Also stop
unnecessarily assigning constant false to m_old_mkudffs in
get_filesystem_support() because it is already initialised to false by
the default constructor.
This commit is contained in:
Mike Fleetwood 2024-08-04 12:50:55 +01:00
parent 8f3395ffb0
commit 181a801734
2 changed files with 5 additions and 5 deletions

View File

@ -30,7 +30,7 @@ namespace GParted
class udf : public FileSystem class udf : public FileSystem
{ {
public: public:
udf() : old_mkudffs( false ) {}; udf() : m_old_mkudffs(false) {};
FS get_filesystem_support(); FS get_filesystem_support();
FS_Limits get_filesystem_limits( const Partition & partition ) const; FS_Limits get_filesystem_limits( const Partition & partition ) const;
@ -45,9 +45,10 @@ private:
static bool contains_only_ascii( const Glib::ustring & str ); static bool contains_only_ascii( const Glib::ustring & str );
static size_t find_first_non_latin1( const Glib::ustring & str ); static size_t find_first_non_latin1( const Glib::ustring & str );
bool old_mkudffs; // Pre 1.1 version of mkudffs bool m_old_mkudffs; // Pre 1.1 version of mkudffs
}; };
} //GParted } //GParted
#endif /* GPARTED_UDF_H */ #endif /* GPARTED_UDF_H */

View File

@ -41,7 +41,6 @@ FS udf::get_filesystem_support()
fs.copy = FS::GPARTED; fs.copy = FS::GPARTED;
fs.online_read = FS::GPARTED; fs.online_read = FS::GPARTED;
old_mkudffs = false;
if ( ! Glib::find_program_in_path( "mkudffs" ).empty() ) if ( ! Glib::find_program_in_path( "mkudffs" ).empty() )
{ {
fs.create = FS::EXTERNAL; fs.create = FS::EXTERNAL;
@ -49,7 +48,7 @@ FS udf::get_filesystem_support()
// Detect old mkudffs prior to version 1.1 by lack of --label option. // Detect old mkudffs prior to version 1.1 by lack of --label option.
Utils::execute_command( "mkudffs --help", output, error, true ); Utils::execute_command( "mkudffs --help", output, error, true );
old_mkudffs = Utils::regexp_label( output + error, "--label" ).empty(); m_old_mkudffs = Utils::regexp_label(output + error, "--label").empty();
} }
if ( ! Glib::find_program_in_path( "udfinfo" ).empty() ) if ( ! Glib::find_program_in_path( "udfinfo" ).empty() )
@ -205,7 +204,7 @@ bool udf::create( const Partition & new_partition, OperationDetail & operationde
// Mkudffs from udftools prior to version 1.1 damages the label if it // Mkudffs from udftools prior to version 1.1 damages the label if it
// contains non-ASCII characters. Therefore do not allow a label with // contains non-ASCII characters. Therefore do not allow a label with
// such characters with old versions of mkudffs. // such characters with old versions of mkudffs.
if ( old_mkudffs && ! contains_only_ascii( label ) ) if (m_old_mkudffs && ! contains_only_ascii(label))
{ {
operationdetail.add_child( OperationDetail( operationdetail.add_child( OperationDetail(
_("mkudffs prior to version 1.1 does not support non-ASCII characters in the label."), _("mkudffs prior to version 1.1 does not support non-ASCII characters in the label."),