mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 02:45:44 -05:00
Make che color cache indexed by UUID instead of by path.
This commit is contained in:
parent
39b8ac83ae
commit
754cfc78b3
1 changed files with 9 additions and 4 deletions
|
@ -84,8 +84,11 @@ colorForPartition( Partition* partition )
|
|||
return FREE_SPACE_COLOR;
|
||||
if ( partition->roles().has( PartitionRole::Extended ) )
|
||||
return EXTENDED_COLOR;
|
||||
if ( s_partitionColorsCache.contains( partition->partitionPath() ) )
|
||||
return s_partitionColorsCache[ partition->partitionPath() ];
|
||||
|
||||
if ( partition->fileSystem().supportGetUUID() != FileSystem::cmdSupportNone &&
|
||||
!partition->fileSystem().uuid().isEmpty() &&
|
||||
s_partitionColorsCache.contains( partition->fileSystem().uuid() ) )
|
||||
return s_partitionColorsCache[ partition->fileSystem().uuid() ];
|
||||
|
||||
// No partition-specific color needed, pick one from our list, but skip
|
||||
// free space: we don't want a partition to change colors if space before
|
||||
|
@ -114,8 +117,10 @@ colorForPartition( Partition* partition )
|
|||
if ( KPMHelpers::isPartitionNew( partition ) )
|
||||
return NEW_PARTITION_COLORS[ newColorIdx % NUM_NEW_PARTITION_COLORS ];
|
||||
|
||||
s_partitionColorsCache.insert( partition->partitionPath(),
|
||||
PARTITION_COLORS[ colorIdx % NUM_PARTITION_COLORS ] );
|
||||
if ( partition->fileSystem().supportGetUUID() != FileSystem::cmdSupportNone &&
|
||||
!partition->fileSystem().uuid().isEmpty() )
|
||||
s_partitionColorsCache.insert( partition->fileSystem().uuid(),
|
||||
PARTITION_COLORS[ colorIdx % NUM_PARTITION_COLORS ] );
|
||||
return PARTITION_COLORS[ colorIdx % NUM_PARTITION_COLORS ];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue