[gparted] Tidy-up GParted_Core::init/fini_filesystems() function declarations



commit df000a94a620ee195abfcd2090718f33de70ec81
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Fri Apr 24 21:57:49 2015 +0100

    Tidy-up GParted_Core::init/fini_filesystems() function declarations
    
    These member functions are only used within the GParted_Core class and
    only operate on the static member variable FILESYSTEM_MAP.
    
    Make both functions private and also make init_filesystems() static.

 include/GParted_Core.h |    5 ++-
 src/GParted_Core.cc    |   78 ++++++++++++++++++++++++------------------------
 2 files changed, 42 insertions(+), 41 deletions(-)
---
diff --git a/include/GParted_Core.h b/include/GParted_Core.h
index 538c4cf..65e8bb0 100644
--- a/include/GParted_Core.h
+++ b/include/GParted_Core.h
@@ -35,8 +35,6 @@ public:
        GParted_Core() ;
        ~GParted_Core() ;
 
-       void init_filesystems() ;
-       static void fini_filesystems();
        void find_supported_filesystems() ;
        void set_user_devices( const std::vector<Glib::ustring> & user_devices ) ;
        void set_devices( std::vector<Device> & devices ) ;
@@ -188,6 +186,9 @@ private:
        bool update_bootsector( const Partition & partition, OperationDetail & operationdetail ) ;
 
        //general..     
+       static void init_filesystems();
+       static void fini_filesystems();
+
        bool flush_device( PedDevice * lp_device ) ;
        bool get_device( const Glib::ustring & device_path, PedDevice *& lp_device, bool flush = false );
        bool get_disk( PedDevice *& lp_device, PedDisk *& lp_disk, bool strict = true );
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index 8f8bbf6..798c740 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -99,45 +99,6 @@ GParted_Core::GParted_Core()
        find_supported_filesystems() ;
 }
 
-void GParted_Core::init_filesystems()
-{
-       FILESYSTEM_MAP[ FS_UNKNOWN ]         = NULL ;
-       FILESYSTEM_MAP[ FS_CLEARED ]         = NULL ;
-       FILESYSTEM_MAP[ FS_BTRFS ]           = new btrfs() ;
-       FILESYSTEM_MAP[ FS_EXFAT ]           = new exfat() ;
-       FILESYSTEM_MAP[ FS_EXT2 ]            = new ext2( FS_EXT2 ) ;
-       FILESYSTEM_MAP[ FS_EXT3 ]            = new ext2( FS_EXT3 ) ;
-       FILESYSTEM_MAP[ FS_EXT4 ]            = new ext2( FS_EXT4 ) ;
-       FILESYSTEM_MAP[ FS_F2FS ]            = new f2fs() ;
-       FILESYSTEM_MAP[ FS_FAT16 ]           = new fat16( FS_FAT16 ) ;
-       FILESYSTEM_MAP[ FS_FAT32 ]           = new fat16( FS_FAT32 ) ;
-       FILESYSTEM_MAP[ FS_HFS ]             = new hfs() ;
-       FILESYSTEM_MAP[ FS_HFSPLUS ]         = new hfsplus() ;
-       FILESYSTEM_MAP[ FS_JFS ]             = new jfs() ;
-       FILESYSTEM_MAP[ FS_LINUX_SWAP ]      = new linux_swap() ;
-       FILESYSTEM_MAP[ FS_LVM2_PV ]         = new lvm2_pv() ;
-       FILESYSTEM_MAP[ FS_NILFS2 ]          = new nilfs2() ;
-       FILESYSTEM_MAP[ FS_NTFS ]            = new ntfs() ;
-       FILESYSTEM_MAP[ FS_REISER4 ]         = new reiser4() ;
-       FILESYSTEM_MAP[ FS_REISERFS ]        = new reiserfs() ;
-       FILESYSTEM_MAP[ FS_UFS ]             = new ufs() ;
-       FILESYSTEM_MAP[ FS_XFS ]             = new xfs() ;
-       FILESYSTEM_MAP[ FS_BITLOCKER ]       = NULL ;
-       FILESYSTEM_MAP[ FS_LUKS ]            = NULL ;
-       FILESYSTEM_MAP[ FS_LINUX_SWRAID ]    = NULL ;
-       FILESYSTEM_MAP[ FS_LINUX_SWSUSPEND ] = NULL ;
-}
-
-void GParted_Core::fini_filesystems()
-{
-       std::map<FILESYSTEM, FileSystem *>::iterator fs_iter;
-       for ( fs_iter = FILESYSTEM_MAP.begin() ; fs_iter != FILESYSTEM_MAP.end() ; fs_iter ++ )
-       {
-               delete fs_iter->second;
-               fs_iter->second = NULL;
-       }
-}
-
 void GParted_Core::find_supported_filesystems()
 {
        std::map< FILESYSTEM, FileSystem * >::iterator f ;
@@ -3804,6 +3765,45 @@ bool GParted_Core::update_bootsector( const Partition & partition, OperationDeta
        return true ;
 }
 
+void GParted_Core::init_filesystems()
+{
+       FILESYSTEM_MAP[FS_UNKNOWN]         = NULL;
+       FILESYSTEM_MAP[FS_CLEARED]         = NULL;
+       FILESYSTEM_MAP[FS_BTRFS]           = new btrfs();
+       FILESYSTEM_MAP[FS_EXFAT]           = new exfat();
+       FILESYSTEM_MAP[FS_EXT2]            = new ext2( FS_EXT2 );
+       FILESYSTEM_MAP[FS_EXT3]            = new ext2( FS_EXT3 );
+       FILESYSTEM_MAP[FS_EXT4]            = new ext2( FS_EXT4 );
+       FILESYSTEM_MAP[FS_F2FS]            = new f2fs();
+       FILESYSTEM_MAP[FS_FAT16]           = new fat16( FS_FAT16 );
+       FILESYSTEM_MAP[FS_FAT32]           = new fat16( FS_FAT32 );
+       FILESYSTEM_MAP[FS_HFS]             = new hfs();
+       FILESYSTEM_MAP[FS_HFSPLUS]         = new hfsplus();
+       FILESYSTEM_MAP[FS_JFS]             = new jfs();
+       FILESYSTEM_MAP[FS_LINUX_SWAP]      = new linux_swap();
+       FILESYSTEM_MAP[FS_LVM2_PV]         = new lvm2_pv();
+       FILESYSTEM_MAP[FS_NILFS2]          = new nilfs2();
+       FILESYSTEM_MAP[FS_NTFS]            = new ntfs();
+       FILESYSTEM_MAP[FS_REISER4]         = new reiser4();
+       FILESYSTEM_MAP[FS_REISERFS]        = new reiserfs();
+       FILESYSTEM_MAP[FS_UFS]             = new ufs();
+       FILESYSTEM_MAP[FS_XFS]             = new xfs();
+       FILESYSTEM_MAP[FS_BITLOCKER]       = NULL;
+       FILESYSTEM_MAP[FS_LUKS]            = NULL;
+       FILESYSTEM_MAP[FS_LINUX_SWRAID]    = NULL;
+       FILESYSTEM_MAP[FS_LINUX_SWSUSPEND] = NULL;
+}
+
+void GParted_Core::fini_filesystems()
+{
+       std::map<FILESYSTEM, FileSystem *>::iterator fs_iter;
+       for ( fs_iter = FILESYSTEM_MAP.begin() ; fs_iter != FILESYSTEM_MAP.end() ; fs_iter ++ )
+       {
+               delete fs_iter->second;
+               fs_iter->second = NULL;
+       }
+}
+
 //Flush the Linux kernel caches, and therefore ensure coherency between the caches of the
 //  whole disk device and the partition devices.
 //


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