From 9f1f3a8f54dc3f44440351687ce1303100e88f00 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 27 Jul 2016 16:49:13 +0200 Subject: [PATCH] Add invalidateCache to ColorUtils. --- src/modules/partition/core/ColorUtils.cpp | 9 ++++++++- src/modules/partition/core/ColorUtils.h | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/modules/partition/core/ColorUtils.cpp b/src/modules/partition/core/ColorUtils.cpp index 7266ceb0a..1df6706fe 100644 --- a/src/modules/partition/core/ColorUtils.cpp +++ b/src/modules/partition/core/ColorUtils.cpp @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2014, Aurélien Gâteau - * Copyright 2015, Teo Mrnjavac + * Copyright 2015-2016, Teo Mrnjavac * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -143,4 +143,11 @@ colorForPartitionInFreeSpace( Partition* partition ) return NEW_PARTITION_COLORS[ newColorIdx % NUM_NEW_PARTITION_COLORS ]; } + +void +invalidateCache() +{ + s_partitionColorsCache.clear(); +} + } // namespace diff --git a/src/modules/partition/core/ColorUtils.h b/src/modules/partition/core/ColorUtils.h index 7cbe8f313..e5a77dea7 100644 --- a/src/modules/partition/core/ColorUtils.h +++ b/src/modules/partition/core/ColorUtils.h @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2014, Aurélien Gâteau + * Copyright 2016, Teo Mrnjavac * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,6 +42,8 @@ QColor colorForPartition( Partition* partition ); */ QColor colorForPartitionInFreeSpace( Partition* freeSpacePartition ); +void invalidateCache(); + } #endif /* COLORUTILS_H */