[gparted] Add FILESYSTEM_MAP[FS_UNALLOCATED] entry
- From: Curtis Gedak <gedakc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gparted] Add FILESYSTEM_MAP[FS_UNALLOCATED] entry
- Date: Sat, 30 Jan 2016 17:40:54 +0000 (UTC)
commit 7870a92b8097b3b8067cc87b891451d5164e9b74
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date: Fri Nov 13 17:43:53 2015 +0000
Add FILESYSTEM_MAP[FS_UNALLOCATED] entry
When displaying an unallocated partition
Win_GParted::set_valid_operations() calls GParted_Core::get_fs() with
parameter FS_UNALLOCATED.
Before this change, get_fs() would fail to find file system capabilities
set for FS_UNALLOCATED and construct a not supported capabilities set
and return that.
Afterwards, find_supported_filesystems() creates a not supported
capabilities set from the NULL pointer for FS_UNALLOCATED and adds this
entry into the FILESYSTEMS vector. Then get_fs() finds that not
supported capabilities set for FS_UNALLOCATED in the FILESYSTEMS vector
and returns that.
This makes no functional difference. It just seems right as other
unsupported but used file system types have entries in FILESYSTEM_MAP.
src/GParted_Core.cc | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index cd9aa68..ba11b2e 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -113,11 +113,10 @@ void GParted_Core::find_supported_filesystems()
{
std::map< FILESYSTEM, FileSystem * >::iterator f ;
- //Iteration of std::map is ordered according to operator< of the key.
- // Hence the FILESYSTEMS vector is constructed in FILESYSTEM enum
- // order: FS_UNKNOWN, FS_CLEARED, FS_BTRFS, ..., FS_LINUX_SWRAID,
- // LINUX_SWSUSPEND which ultimately controls the default order of file
- // systems in menus and dialogs.
+ // Iteration of std::map is ordered according to operator< of the key. Hence the
+ // FILESYSTEMS vector is constructed in FILESYSTEM enum order: FS_UNALLOCATED,
+ // FS_UNKNOWN, FS_CLEARED, FS_BTRFS, ..., FS_LINUX_SWRAID, LINUX_SWSUSPEND which
+ // ultimately controls the default order of file systems in menus and dialogs.
FILESYSTEMS .clear() ;
for ( f = FILESYSTEM_MAP .begin() ; f != FILESYSTEM_MAP .end() ; f++ ) {
@@ -3897,6 +3896,7 @@ bool GParted_Core::update_bootsector( const Partition & partition, OperationDeta
void GParted_Core::init_filesystems()
{
+ FILESYSTEM_MAP[FS_UNALLOCATED] = NULL;
FILESYSTEM_MAP[FS_UNKNOWN] = NULL;
FILESYSTEM_MAP[FS_CLEARED] = NULL;
FILESYSTEM_MAP[FS_BTRFS] = new btrfs();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]