[gparted] Strip unnecessary scope from GParted::FS_* (!20)



commit e0b6d2c65b52ec614ada1cdafc1b6c88059658e2
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Sun Oct 14 13:37:34 2018 +0100

    Strip unnecessary scope from GParted::FS_* (!20)
    
    The code inconsistently uses GParted:: scope in front of FS_*.
    
        $ fgrep 'GParted::FS_' src/*.cc | wc -l
        41
        $ egrep '[^:]FS_' src/*.cc | wc -l
        441
    
    GParted:: scope resolution is unnecessary as all the code is inside the
    GParted namespace, except for main().  So remove it.
    
    Closes !20 - Minor namespace and scope operator tidy-ups

 src/Dialog_Partition_Copy.cc |  2 +-
 src/Dialog_Partition_New.cc  |  6 +++---
 src/Dialog_Rescue_Data.cc    | 24 ++++++++++++------------
 src/GParted_Core.cc          | 44 ++++++++++++++++++++++----------------------
 src/Partition.cc             |  2 +-
 5 files changed, 39 insertions(+), 39 deletions(-)
---
diff --git a/src/Dialog_Partition_Copy.cc b/src/Dialog_Partition_Copy.cc
index f3aa8ce9..c285799b 100644
--- a/src/Dialog_Partition_Copy.cc
+++ b/src/Dialog_Partition_Copy.cc
@@ -85,7 +85,7 @@ void Dialog_Partition_Copy::set_data( const Partition & selected_partition, cons
                fs_limits.max_size = copied_partition.get_byte_length();
        }
 
-       if ( fs .filesystem == GParted::FS_XFS ) //bit hackisch, but most effective, since it's a unique 
situation
+       if (fs.filesystem == FS_XFS)  // Bit hackish, but most effective, since it's a unique situation.
                fs_limits.min_size = std::max( fs_limits.min_size, min_resize * copied_partition.sector_size 
);
        else
                fs_limits.min_size = COPIED_LENGTH_MB * MEBIBYTE;
diff --git a/src/Dialog_Partition_New.cc b/src/Dialog_Partition_New.cc
index b433491a..da7aba78 100644
--- a/src/Dialog_Partition_New.cc
+++ b/src/Dialog_Partition_New.cc
@@ -75,14 +75,14 @@ void Dialog_Partition_New::set_data( const Device & device,
        this ->FILESYSTEMS .push_back( fs_tmp ) ;
 
        //... add FS_UNFORMATTED
-       fs_tmp .filesystem = GParted::FS_UNFORMATTED ;
+       fs_tmp.filesystem = FS_UNFORMATTED;
        fs_tmp .create = FS::GPARTED ;
        this ->FILESYSTEMS .push_back( fs_tmp ) ;
 
        // ... finally add FS_EXTENDED.  Needed so that when creating an extended
        // partition it is identified correctly before the operation is applied.
        fs_tmp = FS();
-       fs_tmp .filesystem = GParted::FS_EXTENDED ;
+       fs_tmp.filesystem = FS_EXTENDED;
        fs_tmp.create = FS::NONE;
        this ->FILESYSTEMS .push_back( fs_tmp ) ;
        
@@ -396,7 +396,7 @@ void Dialog_Partition_New::build_filesystems_combo(bool only_unformatted)
        for ( unsigned int t = 0 ; t < FILESYSTEMS .size( ) ; t++ ) 
        {
                //skip extended
-               if( FILESYSTEMS[ t ] .filesystem == GParted::FS_EXTENDED )
+               if (FILESYSTEMS[t].filesystem == FS_EXTENDED)
                        continue ;
                combo_filesystem.items().push_back(Utils::get_filesystem_string(FILESYSTEMS[t].filesystem));
                combo_filesystem.items().back().set_sensitive(
diff --git a/src/Dialog_Rescue_Data.cc b/src/Dialog_Rescue_Data.cc
index 50410346..319ecf6c 100644
--- a/src/Dialog_Rescue_Data.cc
+++ b/src/Dialog_Rescue_Data.cc
@@ -109,10 +109,10 @@ void Dialog_Rescue_Data::create_list_of_fs()
 
        for(unsigned int i=0;i<this->partitions.size();i++)
        {
-               if(this->partitions[i].filesystem==GParted::FS_UNALLOCATED
-                       || this->partitions[i].filesystem==GParted::FS_UNKNOWN
-                       || this->partitions[i].filesystem==GParted::FS_UNFORMATTED
-                       || this->partitions[i].filesystem==GParted::FS_EXTENDED
+               if (this->partitions[i].filesystem == FS_UNALLOCATED
+                       || this->partitions[i].filesystem == FS_UNKNOWN
+                       || this->partitions[i].filesystem == FS_UNFORMATTED
+                       || this->partitions[i].filesystem == FS_EXTENDED
                        || this->partitions[i].type==GParted::TYPE_EXTENDED
                        || this->partitions[i].type==GParted::TYPE_UNALLOCATED)
                {
@@ -358,14 +358,14 @@ void Dialog_Rescue_Data::read_partitions_from_buffer()
                                        {
                                                case 0x83: //FS code for ext2, reiserfs and xfs
                                                {
-                                                       fs=GParted::FS_EXT2;
+                                                       fs = FS_EXT2;
                                                        break;
                                                }
                                                case 0x18:
                                                case 0x82:
                                                case 0xB8: //SWAP partition
                                                {
-                                                       fs=GParted::FS_LINUX_SWAP;
+                                                       fs = FS_LINUX_SWAP;
                                                        break;
                                                }
                                                case 0x04:
@@ -373,31 +373,31 @@ void Dialog_Rescue_Data::read_partitions_from_buffer()
                                                case 0x86:
                                                case 0xE4: //FAT16
                                                {
-                                                       fs=GParted::FS_FAT16;
+                                                       fs = FS_FAT16;
                                                        break;
                                                }
                                                case 0x0B:
                                                case 0x0C: //FAT32
                                                {
-                                                       fs=GParted::FS_FAT32;
+                                                       fs = FS_FAT32;
                                                        break;
                                                }
                                                case 0x07: //NTFS, HPFS, exFAT and UDF
                                                {
-                                                       fs=GParted::FS_NTFS;
+                                                       fs = FS_NTFS;
                                                        break;
                                                }
                                                case 0x05:
                                                case 0x0F:
                                                case 0x85: //Extended
                                                {
-                                                       fs=GParted::FS_EXTENDED;
+                                                       fs = FS_EXTENDED;
                                                        type=GParted::TYPE_EXTENDED;
                                                        break;
                                                }
                                                default:
                                                {
-                                                       fs=GParted::FS_UNKNOWN;
+                                                       fs = FS_UNKNOWN;
                                                }
                                        }
                                }
@@ -419,7 +419,7 @@ void Dialog_Rescue_Data::read_partitions_from_buffer()
                        }
 
                        //Swap partitions don't contain data
-                       if(fs==GParted::FS_LINUX_SWAP)
+                       if (fs == FS_LINUX_SWAP)
                        {
                                continue;
                        }
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index c8d2828d..da6ca942 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -1434,57 +1434,57 @@ FSType GParted_Core::detect_filesystem( PedDevice * lp_device, PedPartition * lp
        if ( ! fsname.empty() )
        {
                if ( fsname == "extended" )
-                       return GParted::FS_EXTENDED ;
+                       return FS_EXTENDED;
                else if ( fsname == "btrfs" )
-                       return GParted::FS_BTRFS ;
+                       return FS_BTRFS;
                else if ( fsname == "exfat" )
-                       return GParted::FS_EXFAT ;
+                       return FS_EXFAT;
                else if ( fsname == "ext2" )
-                       return GParted::FS_EXT2 ;
+                       return FS_EXT2;
                else if ( fsname == "ext3" )
-                       return GParted::FS_EXT3 ;
+                       return FS_EXT3;
                else if ( fsname == "ext4"    ||
                          fsname == "ext4dev"    )
-                       return GParted::FS_EXT4 ;
+                       return FS_EXT4;
                else if ( fsname == "linux-swap"      ||
                          fsname == "linux-swap(v1)"  ||
                          fsname == "linux-swap(new)" ||
                          fsname == "linux-swap(v0)"  ||
                          fsname == "linux-swap(old)" ||
                          fsname == "swap"               )
-                       return GParted::FS_LINUX_SWAP ;
+                       return FS_LINUX_SWAP;
                else if ( fsname == "crypto_LUKS" )
                        return FS_LUKS;
                else if ( fsname == "LVM2_member" )
-                       return GParted::FS_LVM2_PV ;
+                       return FS_LVM2_PV;
                else if ( fsname == "f2fs" )
-                       return GParted::FS_F2FS ;
+                       return FS_F2FS;
                else if ( fsname == "fat16" )
-                       return GParted::FS_FAT16 ;
+                       return FS_FAT16;
                else if ( fsname == "fat32" )
-                       return GParted::FS_FAT32 ;
+                       return FS_FAT32;
                else if ( fsname == "minix" )
                        return FS_MINIX;
                else if ( fsname == "nilfs2" )
-                       return GParted::FS_NILFS2 ;
+                       return FS_NILFS2;
                else if ( fsname == "ntfs" )
-                       return GParted::FS_NTFS ;
+                       return FS_NTFS;
                else if ( fsname == "reiserfs" )
-                       return GParted::FS_REISERFS ;
+                       return FS_REISERFS;
                else if ( fsname == "xfs" )
-                       return GParted::FS_XFS ;
+                       return FS_XFS;
                else if ( fsname == "jfs" )
-                       return GParted::FS_JFS ;
+                       return FS_JFS;
                else if ( fsname == "hfs" )
-                       return GParted::FS_HFS ;
+                       return FS_HFS;
                else if ( fsname == "hfs+"    ||
                          fsname == "hfsx"    ||
                          fsname == "hfsplus"    )
-                       return GParted::FS_HFSPLUS ;
+                       return FS_HFSPLUS;
                else if ( fsname == "udf" )
-                       return GParted::FS_UDF;
+                       return FS_UDF;
                else if ( fsname == "ufs" )
-                       return GParted::FS_UFS ;
+                       return FS_UFS;
                else if ( fsname == "apfs" )
                        return FS_APFS;
                else if ( fsname == "BitLocker" )
@@ -1520,8 +1520,8 @@ FSType GParted_Core::detect_filesystem( PedDevice * lp_device, PedPartition * lp
        temp += String::ucompose( _("The device entry %1 is missing"), path );
        
        messages .push_back( temp ) ;
-       
-       return GParted::FS_UNKNOWN ;
+
+       return FS_UNKNOWN;
 }
        
 void GParted_Core::read_label( Partition & partition )
diff --git a/src/Partition.cc b/src/Partition.cc
index 13058772..bf942749 100644
--- a/src/Partition.cc
+++ b/src/Partition.cc
@@ -41,7 +41,7 @@ void Partition::Reset()
        status = GParted::STAT_REAL ;
        type = GParted::TYPE_UNALLOCATED ;
        alignment = ALIGN_STRICT ;
-       filesystem = GParted::FS_UNALLOCATED ;
+       filesystem = FS_UNALLOCATED;
        have_filesystem_label = false;
        uuid .clear() ;
        name.clear();


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