Rename Utils method parameters of type FSType (!52)

Closes !52 - Rename members and variables currently named 'filesystem'
This commit is contained in:
Mike Fleetwood 2019-06-13 10:41:34 +01:00
parent 58fb230fb0
commit c85fc66dcf
2 changed files with 19 additions and 15 deletions

View File

@ -137,15 +137,15 @@ public:
Gtk::IconSize icon_size); Gtk::IconSize icon_size);
static Glib::ustring get_stock_label(const Gtk::StockID& stock_id); static Glib::ustring get_stock_label(const Gtk::StockID& stock_id);
static Glib::ustring num_to_str( Sector number ) ; static Glib::ustring num_to_str( Sector number ) ;
static Glib::ustring get_color( FSType filesystem ); static Glib::ustring get_color(FSType fstype);
static Glib::RefPtr<Gdk::Pixbuf> get_color_as_pixbuf( FSType filesystem, int width, int height ); static Glib::RefPtr<Gdk::Pixbuf> get_color_as_pixbuf(FSType fstype, int width, int height);
static int get_max_partition_name_length( Glib::ustring & tabletype ); static int get_max_partition_name_length( Glib::ustring & tabletype );
static int get_filesystem_label_maxlength( FSType filesystem ); static int get_filesystem_label_maxlength(FSType fstype);
static Glib::ustring get_filesystem_string( FSType filesystem ); static Glib::ustring get_filesystem_string(FSType fstype);
static const Glib::ustring get_encrypted_string(); static const Glib::ustring get_encrypted_string();
static const Glib::ustring get_filesystem_string( bool encrypted, FSType fstype ); static const Glib::ustring get_filesystem_string( bool encrypted, FSType fstype );
static const Glib::ustring get_filesystem_kernel_name( FSType fstype ); static const Glib::ustring get_filesystem_kernel_name( FSType fstype );
static Glib::ustring get_filesystem_software( FSType filesystem ); static Glib::ustring get_filesystem_software(FSType fstype);
static bool kernel_supports_fs( const Glib::ustring & fs ) ; static bool kernel_supports_fs( const Glib::ustring & fs ) ;
static bool kernel_version_at_least( int major_ver, int minor_ver, int patch_ver ) ; static bool kernel_version_at_least( int major_ver, int minor_ver, int patch_ver ) ;
static Glib::ustring format_size( Sector sectors, Byte_Value sector_size ) ; static Glib::ustring format_size( Sector sectors, Byte_Value sector_size ) ;

View File

@ -145,9 +145,9 @@ Glib::ustring Utils::num_to_str( Sector number )
// [*] Colour not from the GNOME palette. // [*] Colour not from the GNOME palette.
// http://developer.gnome.org/hig-book/2.32/design-color.html.en // http://developer.gnome.org/hig-book/2.32/design-color.html.en
// http://web.archive.org/web/20130922173112/https://developer.gnome.org/hig-book/stable/design-color.html.en // http://web.archive.org/web/20130922173112/https://developer.gnome.org/hig-book/stable/design-color.html.en
Glib::ustring Utils::get_color( FSType filesystem ) Glib::ustring Utils::get_color(FSType fstype)
{ {
switch( filesystem ) switch (fstype)
{ {
case FS_UNSUPPORTED: return "#000000"; // Black (never displayed) case FS_UNSUPPORTED: return "#000000"; // Black (never displayed)
case FS_UNALLOCATED: return "#A9A9A9"; // Medium Grey [*] case FS_UNALLOCATED: return "#A9A9A9"; // Medium Grey [*]
@ -193,13 +193,14 @@ Glib::ustring Utils::get_color( FSType filesystem )
} }
} }
Glib::RefPtr<Gdk::Pixbuf> Utils::get_color_as_pixbuf( FSType filesystem, int width, int height )
Glib::RefPtr<Gdk::Pixbuf> Utils::get_color_as_pixbuf(FSType fstype, int width, int height)
{ {
Glib::RefPtr<Gdk::Pixbuf> pixbuf = Gdk::Pixbuf::create( Gdk::COLORSPACE_RGB, false, 8, width, height ) ; Glib::RefPtr<Gdk::Pixbuf> pixbuf = Gdk::Pixbuf::create( Gdk::COLORSPACE_RGB, false, 8, width, height ) ;
if ( pixbuf ) if ( pixbuf )
{ {
std::stringstream hex( get_color( filesystem ) .substr( 1 ) + "00" ) ; std::stringstream hex(get_color(fstype).substr(1) + "00");
unsigned long dec ; unsigned long dec ;
hex >> std::hex >> dec ; hex >> std::hex >> dec ;
@ -252,9 +253,10 @@ int Utils::get_max_partition_name_length( Glib::ustring & tabletype )
return 0; return 0;
} }
int Utils::get_filesystem_label_maxlength( FSType filesystem )
int Utils::get_filesystem_label_maxlength(FSType fstype)
{ {
switch( filesystem ) switch (fstype)
{ {
//All file systems commented out are not supported for labelling //All file systems commented out are not supported for labelling
// by either the new partition or label partition operations. // by either the new partition or label partition operations.
@ -304,10 +306,11 @@ int Utils::get_filesystem_label_maxlength( FSType filesystem )
} }
} }
// Return libparted file system name / GParted display name // Return libparted file system name / GParted display name
Glib::ustring Utils::get_filesystem_string( FSType filesystem ) Glib::ustring Utils::get_filesystem_string(FSType fstype)
{ {
switch( filesystem ) switch (fstype)
{ {
case FS_UNSUPPORTED: return "unsupported"; // Never displayed case FS_UNSUPPORTED: return "unsupported"; // Never displayed
case FS_UNALLOCATED: case FS_UNALLOCATED:
@ -424,9 +427,10 @@ const Glib::ustring Utils::get_filesystem_kernel_name( FSType fstype )
} }
} }
Glib::ustring Utils::get_filesystem_software( FSType filesystem )
Glib::ustring Utils::get_filesystem_software(FSType fstype)
{ {
switch( filesystem ) switch (fstype)
{ {
case FS_BTRFS : return "btrfs-progs / btrfs-tools" ; case FS_BTRFS : return "btrfs-progs / btrfs-tools" ;
case FS_EXT2 : return "e2fsprogs" ; case FS_EXT2 : return "e2fsprogs" ;