Strip unnecessary scope from GParted::FS::* (!20)

The code inconsistency uses GParted::FS::* and FS::*.

    $ fgrep 'GParted::FS::' src/*.cc | wc -l
    97
    $ egrep '[^:]FS::' src/*.cc | wc -l
    152

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
This commit is contained in:
Mike Fleetwood 2018-10-13 12:59:31 +01:00 committed by Curtis Gedak
parent 2c10dd2caa
commit 7f23761964
15 changed files with 107 additions and 107 deletions

View File

@ -83,7 +83,7 @@ void Dialog_Partition_New::set_data( const Device & device,
// partition it is identified correctly before the operation is applied.
fs_tmp = FS();
fs_tmp .filesystem = GParted::FS_EXTENDED ;
fs_tmp .create = GParted::FS::NONE ;
fs_tmp.create = FS::NONE;
this ->FILESYSTEMS .push_back( fs_tmp ) ;
//add table with selection menu's...

View File

@ -82,8 +82,8 @@ void Dialog_Partition_Resize_Move::Resize_Move_Normal( const PartitionVector & p
if ( ! new_partition->sector_usage_known() &&
new_partition->status != STAT_NEW &&
new_partition->filesystem != FS_LINUX_SWAP )
fs .shrink = GParted::FS::NONE ;
fs.shrink = FS::NONE;
//Disable resizing as it's currently disallowed for the file system in this partition.
// (Updates this class's copy of file system support information).
if ( GParted_Core::filesystem_resize_disallowed( *new_partition ) )

View File

@ -2055,13 +2055,13 @@ bool GParted_Core::create_filesystem( const Partition & partition, OperationDeta
FileSystem* p_filesystem = NULL ;
switch ( get_fs( partition .filesystem ) .create )
{
case GParted::FS::NONE:
case FS::NONE:
break ;
case GParted::FS::GPARTED:
case FS::GPARTED:
break ;
case GParted::FS::LIBPARTED:
case FS::LIBPARTED:
break ;
case GParted::FS::EXTERNAL:
case FS::EXTERNAL:
succes = ( p_filesystem = get_filesystem_object( partition .filesystem ) ) &&
p_filesystem ->create( partition, operationdetail .get_last_child() ) ;
@ -2431,9 +2431,9 @@ bool GParted_Core::move_filesystem( const Partition & partition_old,
Sector total_done = 0;
switch ( get_fs( partition_old .filesystem ) .move )
{
case GParted::FS::NONE:
case FS::NONE:
break ;
case GParted::FS::GPARTED:
case FS::GPARTED:
succes = false ;
if ( partition_new .test_overlap( partition_old ) )
{
@ -2461,9 +2461,9 @@ bool GParted_Core::move_filesystem( const Partition & partition_old,
true );
break ;
case GParted::FS::LIBPARTED:
case FS::LIBPARTED:
break ;
case GParted::FS::EXTERNAL:
case FS::EXTERNAL:
succes = ( p_filesystem = get_filesystem_object( partition_new .filesystem ) ) &&
p_filesystem ->move( partition_old
, partition_new
@ -3006,7 +3006,7 @@ bool GParted_Core::maximize_filesystem( const Partition & partition, OperationDe
// to allow the operation to be queued in the first place. See
// Win_GParted::set_valid_operations() and
// Dialog_Partition_Resize_Move::Resize_Move_Normal().
if ( get_fs( partition .filesystem ) .grow == GParted::FS::NONE )
if (get_fs(partition.filesystem).grow == FS::NONE)
{
operationdetail .get_last_child() .add_child(
OperationDetail( _("growing is not available for this file system"),
@ -3448,7 +3448,7 @@ bool GParted_Core::check_repair_filesystem( const Partition & partition, Operati
FileSystem* p_filesystem = NULL ;
switch ( get_fs( partition .filesystem ) .check )
{
case GParted::FS::NONE:
case FS::NONE:
operationdetail .get_last_child() .add_child(
OperationDetail( _("checking is not available for this file system"),
STATUS_NONE,
@ -3457,11 +3457,11 @@ bool GParted_Core::check_repair_filesystem( const Partition & partition, Operati
return true ;
break ;
case GParted::FS::GPARTED:
case FS::GPARTED:
break ;
case GParted::FS::LIBPARTED:
case FS::LIBPARTED:
break ;
case GParted::FS::EXTERNAL:
case FS::EXTERNAL:
succes = ( p_filesystem = get_filesystem_object( partition .filesystem ) ) &&
p_filesystem ->check_repair( partition, operationdetail .get_last_child() ) ;

View File

@ -47,12 +47,12 @@ FS btrfs::get_filesystem_support()
if ( ! Glib::find_program_in_path( "mkfs.btrfs" ) .empty() )
{
fs .create = GParted::FS::EXTERNAL ;
fs .create_with_label = GParted::FS::EXTERNAL ;
fs.create = FS::EXTERNAL;
fs.create_with_label = FS::EXTERNAL;
}
if ( ! Glib::find_program_in_path( "btrfsck" ) .empty() )
fs .check = GParted::FS::EXTERNAL ;
fs.check = FS::EXTERNAL;
btrfs_found = ( ! Glib::find_program_in_path( "btrfs" ) .empty() ) ;
if ( btrfs_found )
@ -61,7 +61,7 @@ FS btrfs::get_filesystem_support()
// to test for filesystem show and filesystem resize
// sub-commands as they were always included.
fs .read = GParted::FS::EXTERNAL ;
fs.read = FS::EXTERNAL;
fs .read_label = FS::EXTERNAL ;
fs .read_uuid = FS::EXTERNAL ;
@ -89,7 +89,7 @@ FS btrfs::get_filesystem_support()
if ( ! Glib::find_program_in_path( "btrfs-show" ) .empty() )
{
fs .read = GParted::FS::EXTERNAL ;
fs.read = FS::EXTERNAL;
fs .read_label = FS::EXTERNAL ;
fs .read_uuid = FS::EXTERNAL ;
}
@ -118,8 +118,8 @@ FS btrfs::get_filesystem_support()
if ( fs .check )
{
fs .copy = GParted::FS::GPARTED ;
fs .move = GParted::FS::GPARTED ;
fs.copy = FS::GPARTED;
fs.move = FS::GPARTED;
}
fs .online_read = FS::EXTERNAL ;

View File

@ -29,8 +29,8 @@ FS f2fs::get_filesystem_support()
if ( ! Glib::find_program_in_path( "mkfs.f2fs" ) .empty() )
{
fs .create = GParted::FS::EXTERNAL ;
fs .create_with_label = GParted::FS::EXTERNAL ;
fs.create = FS::EXTERNAL;
fs.create_with_label = FS::EXTERNAL;
}
fs .copy = FS::GPARTED ;

View File

@ -66,27 +66,27 @@ FS fat16::get_filesystem_support()
//find out if we can create fat file systems
if ( ! Glib::find_program_in_path( "mkfs.fat" ) .empty() )
{
fs .create = GParted::FS::EXTERNAL ;
fs .create_with_label = GParted::FS::EXTERNAL ;
fs.create = FS::EXTERNAL;
fs.create_with_label = FS::EXTERNAL;
create_cmd = "mkfs.fat" ;
}
else if ( ! Glib::find_program_in_path( "mkdosfs" ) .empty() )
{
fs .create = GParted::FS::EXTERNAL ;
fs .create_with_label = GParted::FS::EXTERNAL ;
fs.create = FS::EXTERNAL;
fs.create_with_label = FS::EXTERNAL;
create_cmd = "mkdosfs" ;
}
if ( ! Glib::find_program_in_path( "fsck.fat" ) .empty() )
{
fs .check = GParted::FS::EXTERNAL ;
fs .read = GParted::FS::EXTERNAL ;
fs.check = FS::EXTERNAL;
fs.read = FS::EXTERNAL;
check_cmd = "fsck.fat" ;
}
else if ( ! Glib::find_program_in_path( "dosfsck" ) .empty() )
{
fs .check = GParted::FS::EXTERNAL ;
fs .read = GParted::FS::EXTERNAL ;
fs.check = FS::EXTERNAL;
fs.read = FS::EXTERNAL;
check_cmd = "dosfsck" ;
}
@ -101,11 +101,11 @@ FS fat16::get_filesystem_support()
#ifdef HAVE_LIBPARTED_FS_RESIZE
//resizing of start and endpoint are provided by libparted
fs .grow = GParted::FS::LIBPARTED ;
fs .shrink = GParted::FS::LIBPARTED ;
fs.grow = FS::LIBPARTED;
fs.shrink = FS::LIBPARTED;
#endif
fs .move = FS::GPARTED ;
fs .copy = GParted::FS::GPARTED ;
fs.copy = FS::GPARTED;
fs .online_read = FS::GPARTED ;
if ( fs .filesystem == FS_FAT16 )

View File

@ -29,21 +29,21 @@ FS hfs::get_filesystem_support()
fs .busy = FS::GPARTED ;
#ifdef HAVE_LIBPARTED_FS_RESIZE
fs .read = GParted::FS::LIBPARTED ;
fs .shrink = GParted::FS::LIBPARTED ;
fs.read = FS::LIBPARTED;
fs.shrink = FS::LIBPARTED;
#endif
if ( ! Glib::find_program_in_path( "hformat" ) .empty() )
{
fs .create = GParted::FS::EXTERNAL ;
fs .create_with_label = GParted::FS::EXTERNAL ;
fs.create = FS::EXTERNAL;
fs.create_with_label = FS::EXTERNAL;
}
if ( ! Glib::find_program_in_path( "hfsck" ) .empty() )
fs .check = FS::EXTERNAL ;
fs .copy = GParted::FS::GPARTED ;
fs .move = GParted::FS::GPARTED ;
fs.copy = FS::GPARTED;
fs.move = FS::GPARTED;
fs .online_read = FS::GPARTED ;
fs_limits.max_size = 2048 * MEBIBYTE;

View File

@ -29,21 +29,21 @@ FS hfsplus::get_filesystem_support()
fs .busy = FS::GPARTED ;
#ifdef HAVE_LIBPARTED_FS_RESIZE
fs .read = GParted::FS::LIBPARTED ;
fs .shrink = GParted::FS::LIBPARTED ;
fs.read = FS::LIBPARTED;
fs.shrink = FS::LIBPARTED;
#endif
if ( ! Glib::find_program_in_path( "mkfs.hfsplus" ) .empty() )
{
fs .create = GParted::FS::EXTERNAL ;
fs .create_with_label = GParted::FS::EXTERNAL ;
fs.create = FS::EXTERNAL;
fs.create_with_label = FS::EXTERNAL;
}
if ( ! Glib::find_program_in_path( "fsck.hfsplus" ) .empty() )
fs .check = FS::EXTERNAL ;
fs .copy = GParted::FS::GPARTED ;
fs .move = GParted::FS::GPARTED ;
fs.copy = FS::GPARTED;
fs.move = FS::GPARTED;
fs .online_read = FS::GPARTED ;
return fs ;

View File

@ -29,9 +29,9 @@ FS jfs::get_filesystem_support()
fs .busy = FS::GPARTED ;
if ( ! Glib::find_program_in_path( "jfs_debugfs" ) .empty() ) {
fs .read = GParted::FS::EXTERNAL ;
fs.read = FS::EXTERNAL;
}
if ( ! Glib::find_program_in_path( "jfs_tune" ) .empty() ) {
fs .read_label = FS::EXTERNAL ;
fs .write_label = FS::EXTERNAL ;
@ -41,26 +41,26 @@ FS jfs::get_filesystem_support()
if ( ! Glib::find_program_in_path( "mkfs.jfs" ) .empty() )
{
fs .create = GParted::FS::EXTERNAL ;
fs .create_with_label = GParted::FS::EXTERNAL ;
fs.create = FS::EXTERNAL;
fs.create_with_label = FS::EXTERNAL;
}
if ( ! Glib::find_program_in_path( "jfs_fsck" ) .empty() )
fs .check = GParted::FS::EXTERNAL ;
fs.check = FS::EXTERNAL;
//resizing of jfs requires mount, unmount, check/repair functionality and jfs support in the kernel
if ( ! Glib::find_program_in_path( "mount" ) .empty() &&
! Glib::find_program_in_path( "umount" ) .empty() &&
fs .check &&
Utils::kernel_supports_fs( "jfs" ) )
{
fs .grow = GParted::FS::EXTERNAL ;
fs.grow = FS::EXTERNAL;
}
if ( fs .check )
{
fs .move = GParted::FS::GPARTED ;
fs .copy = GParted::FS::GPARTED ;
fs.move = FS::GPARTED;
fs.copy = FS::GPARTED;
}
fs .online_read = FS::GPARTED ;

View File

@ -52,10 +52,10 @@ FS linux_swap::get_filesystem_support()
if ( ! Glib::find_program_in_path( "mkswap" ) .empty() )
{
fs .create = GParted::FS::EXTERNAL ;
fs .create_with_label = GParted::FS::EXTERNAL ;
fs .grow = GParted::FS::EXTERNAL ;
fs .shrink = GParted::FS::EXTERNAL ;
fs.create = FS::EXTERNAL;
fs.create_with_label = FS::EXTERNAL;
fs.grow = FS::EXTERNAL;
fs.shrink = FS::EXTERNAL;
fs.copy = FS::EXTERNAL;
fs.move = FS::EXTERNAL;
}

View File

@ -29,17 +29,17 @@ FS nilfs2::get_filesystem_support()
if ( ! Glib::find_program_in_path( "mkfs.nilfs2" ) .empty() )
{
fs .create = GParted::FS::EXTERNAL ;
fs .create_with_label = GParted::FS::EXTERNAL ;
fs.create = FS::EXTERNAL;
fs.create_with_label = FS::EXTERNAL;
}
if ( ! Glib::find_program_in_path( "nilfs-tune" ) .empty() )
{
fs .read = GParted::FS::EXTERNAL ;
fs .read_label = GParted::FS::EXTERNAL ;
fs .write_label = GParted::FS::EXTERNAL ;
fs .read_uuid = GParted::FS::EXTERNAL ;
fs .write_uuid = GParted::FS::EXTERNAL ;
fs.read = FS::EXTERNAL;
fs.read_label = FS::EXTERNAL;
fs.write_label = FS::EXTERNAL;
fs.read_uuid = FS::EXTERNAL;
fs.write_uuid = FS::EXTERNAL;
}
//Nilfs2 resizing is an online only operation and needs:
@ -50,13 +50,13 @@ FS nilfs2::get_filesystem_support()
Utils::kernel_supports_fs( "nilfs2" ) &&
Utils::kernel_version_at_least( 3, 0, 0 ) )
{
fs .grow = GParted::FS::EXTERNAL ;
fs.grow = FS::EXTERNAL;
if ( fs .read ) //needed to determine a minimum file system size.
fs .shrink = GParted::FS::EXTERNAL ;
fs.shrink = FS::EXTERNAL;
}
fs .copy = GParted::FS::GPARTED ;
fs .move = GParted::FS::GPARTED ;
fs.copy = FS::GPARTED;
fs.move = FS::GPARTED;
fs .online_read = FS::GPARTED ;
#ifdef ENABLE_ONLINE_RESIZE
if ( Utils::kernel_version_at_least( 3, 6, 0 ) )

View File

@ -61,8 +61,8 @@ FS ntfs::get_filesystem_support()
if ( ! Glib::find_program_in_path( "ntfsresize" ) .empty() )
{
fs .read = GParted::FS::EXTERNAL ;
fs .check = GParted::FS::EXTERNAL ;
fs.read = FS::EXTERNAL;
fs.check = FS::EXTERNAL;
}
if ( ! Glib::find_program_in_path( "ntfslabel" ) .empty() ) {
@ -85,25 +85,25 @@ FS ntfs::get_filesystem_support()
if ( ! Glib::find_program_in_path( "mkntfs" ) .empty() )
{
fs .create = GParted::FS::EXTERNAL ;
fs .create_with_label = GParted::FS::EXTERNAL ;
fs.create = FS::EXTERNAL;
fs.create_with_label = FS::EXTERNAL;
}
//resizing is a delicate process ...
if ( fs .read && fs .check )
{
fs .grow = GParted::FS::EXTERNAL ;
fs.grow = FS::EXTERNAL;
if ( fs .read ) //needed to determine a min file system size..
fs .shrink = GParted::FS::EXTERNAL ;
fs.shrink = FS::EXTERNAL;
}
//we need ntfsresize to set correct used/unused after cloning
if ( ! Glib::find_program_in_path( "ntfsclone" ) .empty() )
fs .copy = GParted::FS::EXTERNAL ;
fs.copy = FS::EXTERNAL;
if ( fs .check )
fs .move = GParted::FS::GPARTED ;
fs.move = FS::GPARTED;
fs .online_read = FS::GPARTED ;

View File

@ -30,24 +30,24 @@ FS reiser4::get_filesystem_support()
if ( ! Glib::find_program_in_path( "debugfs.reiser4" ) .empty() )
{
fs .read = GParted::FS::EXTERNAL ;
fs.read = FS::EXTERNAL;
fs .read_label = FS::EXTERNAL ;
fs .read_uuid = GParted::FS::EXTERNAL ;
fs.read_uuid = FS::EXTERNAL;
}
if ( ! Glib::find_program_in_path( "mkfs.reiser4" ) .empty() )
{
fs .create = GParted::FS::EXTERNAL ;
fs .create_with_label = GParted::FS::EXTERNAL ;
fs.create = FS::EXTERNAL;
fs.create_with_label = FS::EXTERNAL;
}
if ( ! Glib::find_program_in_path( "fsck.reiser4" ) .empty() )
fs .check = GParted::FS::EXTERNAL ;
fs.check = FS::EXTERNAL;
if ( fs .check )
{
fs .copy = GParted::FS::GPARTED ;
fs .move = GParted::FS::GPARTED ;
fs.copy = FS::GPARTED;
fs.move = FS::GPARTED;
}
fs .online_read = FS::GPARTED ;

View File

@ -30,7 +30,7 @@ FS reiserfs::get_filesystem_support()
if ( ! Glib::find_program_in_path( "debugreiserfs" ) .empty() )
{
fs .read = GParted::FS::EXTERNAL ;
fs.read = FS::EXTERNAL;
fs .read_label = FS::EXTERNAL ;
}
@ -43,26 +43,26 @@ FS reiserfs::get_filesystem_support()
if ( ! Glib::find_program_in_path( "mkreiserfs" ) .empty() )
{
fs .create = GParted::FS::EXTERNAL ;
fs .create_with_label = GParted::FS::EXTERNAL ;
fs.create = FS::EXTERNAL;
fs.create_with_label = FS::EXTERNAL;
}
if ( ! Glib::find_program_in_path( "reiserfsck" ) .empty() )
fs .check = GParted::FS::EXTERNAL ;
fs.check = FS::EXTERNAL;
//resizing is a delicate process ...
if ( ! Glib::find_program_in_path( "resize_reiserfs" ) .empty() && fs .check )
{
fs .grow = GParted::FS::EXTERNAL ;
fs.grow = FS::EXTERNAL;
if ( fs .read ) //needed to determine a min file system size..
fs .shrink = GParted::FS::EXTERNAL ;
fs.shrink = FS::EXTERNAL;
}
if ( fs .check )
{
fs .copy = GParted::FS::GPARTED ;
fs .move = GParted::FS::GPARTED ;
fs.copy = FS::GPARTED;
fs.move = FS::GPARTED;
}
fs .online_read = FS::GPARTED ;

View File

@ -34,7 +34,7 @@ FS xfs::get_filesystem_support()
if ( ! Glib::find_program_in_path( "xfs_db" ) .empty() )
{
fs .read = GParted::FS::EXTERNAL ;
fs.read = FS::EXTERNAL;
fs .read_label = FS::EXTERNAL ;
}
@ -47,13 +47,13 @@ FS xfs::get_filesystem_support()
if ( ! Glib::find_program_in_path( "mkfs.xfs" ) .empty() )
{
fs .create = GParted::FS::EXTERNAL ;
fs .create_with_label = GParted::FS::EXTERNAL ;
fs.create = FS::EXTERNAL;
fs.create_with_label = FS::EXTERNAL;
}
if ( ! Glib::find_program_in_path( "xfs_repair" ) .empty() )
fs .check = GParted::FS::EXTERNAL ;
fs.check = FS::EXTERNAL;
//Mounted operations require mount, umount and xfs support in the kernel
if ( ! Glib::find_program_in_path( "mount" ) .empty() &&
! Glib::find_program_in_path( "umount" ) .empty() &&
@ -72,7 +72,7 @@ FS xfs::get_filesystem_support()
}
if ( fs .check )
fs .move = GParted::FS::GPARTED ;
fs.move = FS::GPARTED;
fs .online_read = FS::GPARTED ;
#ifdef ENABLE_ONLINE_RESIZE