From 3c9d85d8428149c51ec12d6bd561863d6a161c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sat, 7 Apr 2018 19:05:05 +0100 Subject: [PATCH] Use enums instead of ints when choosing filesystem color in KConfig. --- src/config/configurepagefilesystemcolors.ui | 170 ++++++++++---------- src/partitionmanager.kcfg | 101 ++++++++---- src/util/guihelpers.cpp | 6 +- 3 files changed, 155 insertions(+), 122 deletions(-) diff --git a/src/config/configurepagefilesystemcolors.ui b/src/config/configurepagefilesystemcolors.ui index 5b2f267..c73b4d3 100644 --- a/src/config/configurepagefilesystemcolors.ui +++ b/src/config/configurepagefilesystemcolors.ui @@ -37,7 +37,7 @@ - + @@ -66,7 +66,7 @@ - + @@ -95,7 +95,7 @@ - + @@ -111,7 +111,7 @@ - + @@ -140,7 +140,7 @@ - + @@ -169,7 +169,7 @@ - + @@ -185,7 +185,7 @@ - + @@ -214,7 +214,7 @@ - + @@ -243,7 +243,7 @@ - + @@ -258,10 +258,10 @@ - - + + - ZFS: + HPFS: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -271,6 +271,22 @@ + + + + + + + Qt::Horizontal + + + + 28 + 17 + + + + @@ -285,7 +301,7 @@ - + @@ -314,36 +330,7 @@ - - - - - - Qt::Horizontal - - - - 28 - 17 - - - - - - - - HPFS: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - false - - - - - + @@ -359,7 +346,7 @@ - + @@ -388,7 +375,7 @@ - + @@ -417,7 +404,7 @@ - + @@ -433,7 +420,7 @@ - + @@ -462,7 +449,7 @@ - + @@ -491,36 +478,23 @@ - + + + + + + ZFS: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + false + + - - - - - - exFAT: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - NILFS2: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - + @@ -535,6 +509,19 @@ + + + + exFAT: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + @@ -548,6 +535,19 @@ + + + + NILFS2: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + @@ -562,7 +562,7 @@ - + @@ -591,7 +591,7 @@ - + @@ -620,7 +620,7 @@ - + @@ -636,7 +636,7 @@ - + @@ -665,7 +665,7 @@ - + @@ -694,7 +694,7 @@ - + @@ -717,7 +717,7 @@ - + @@ -746,7 +746,7 @@ - + @@ -775,7 +775,7 @@ - + diff --git a/src/partitionmanager.kcfg b/src/partitionmanager.kcfg index f8b26c7..6513c27 100644 --- a/src/partitionmanager.kcfg +++ b/src/partitionmanager.kcfg @@ -54,40 +54,73 @@ true - + - - - 220,205,175 - 187,249,207 - 102,121,150 - 122,145,180 - 143,170,210 - 155,155,130 - 204,179,215 - 229,201,240 - 244,214,255 - 216,220,135 - 251,255,157 - 200,255,254 - 137,200,198 - 210,136,142 - 240,165,171 - 151,220,134 - 220,205,175 - 173,205,255 - 176,155,185 - 170,30,77 - 96,140,85 - 33,137,108 - 250,230,255 - 242,155,104 - 160,210,180 - 255,170,0 - 170,120,255 - 177,82,69 - 223,39,104 - 204,179,255 + + + + Unknown + Extended + Ext2 + Ext3 + Ext4 + LinuxSwap + Fat16 + Fat32 + Ntfs + ReiserFS + Reiser4 + Xfs + Jfs + Hfs + HfsPlus + Ufs + Unformatted + Btrfs + Hpfs + Luks + Ocfs2 + Zfs + Exfat + Nilfs2 + Lvm2_PV + F2fs + Udf + Iso9660 + Luks2 + Fat12 + + + 220,205,175 + 187,249,207 + 102,121,150 + 122,145,180 + 143,170,210 + 155,155,130 + 204,179,215 + 229,201,240 + 244,214,255 + 216,220,135 + 251,255,157 + 200,255,254 + 137,200,198 + 210,136,142 + 240,165,171 + 151,220,134 + 220,205,175 + 173,205,255 + 176,155,185 + 170,30,77 + 96,140,85 + 33,137,108 + 250,230,255 + 242,155,104 + 160,210,180 + 255,170,0 + 170,120,255 + 177,82,69 + 223,39,104 + 204,179,255 @@ -97,7 +130,7 @@ - FileSystem::Ext4 + FileSystem::Type::Ext4 diff --git a/src/util/guihelpers.cpp b/src/util/guihelpers.cpp index 0f8dbeb..54048b5 100644 --- a/src/util/guihelpers.cpp +++ b/src/util/guihelpers.cpp @@ -119,10 +119,10 @@ FileSystem::Type defaultFileSystem() std::vector fileSystemColorCodesFromSettings() { std::vector cc; - cc.reserve(FileSystem::__lastType); - for (int i = 0; i < FileSystem::__lastType; ++i) + cc.reserve(Config::EnumFileSystem::type::COUNT); + for (int i = 0; i < Config::EnumFileSystem::type::COUNT; ++i) { - cc[ i ] = Config::fileSystemColorCode( i ); + cc[i] = Config::fileSystemColorCode(i); } return cc; }