From 7b092b3fe3c9960a2e2866a3b03818fe63bbbac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 20 Dec 2019 19:09:44 +0100 Subject: Remove clearWidgetPaletteHash argument from setPalette_helper The argument is only used when the application palette is set, (as opposed to setting the palette for a specific widget class), and that code path is only triggered from QApplication::setPalette, which passes 'true' for this argument. Change-Id: I67a1cc3741f6f62653b0f95ff88d28228f9977d4 Reviewed-by: Timur Pocheptsov --- src/widgets/kernel/qapplication.cpp | 9 ++++----- src/widgets/kernel/qapplication_p.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 28575a20f5..ef76265f8b 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -633,7 +633,7 @@ static void setPossiblePalette(const QPalette *palette, const char *className) { if (palette == 0) return; - QApplicationPrivate::setPalette_helper(*palette, className, false); + QApplicationPrivate::setPalette_helper(*palette, className); } void QApplicationPrivate::initializeWidgetPaletteHash() @@ -1363,7 +1363,7 @@ QPalette QApplication::palette(const char *className) return QGuiApplication::palette(); } -void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char* className, bool clearWidgetPaletteHash) +void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char* className) { QPalette pal = palette; @@ -1380,8 +1380,7 @@ void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char* if (!widgetPalettes.isEmpty()) { all = true; - if (clearWidgetPaletteHash) - widgetPalettes.clear(); + widgetPalettes.clear(); } } else { widgetPalettes.insert(className, pal); @@ -1416,7 +1415,7 @@ void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char* void QApplication::setPalette(const QPalette &palette, const char* className) { - QApplicationPrivate::setPalette_helper(palette, className, /*clearWidgetPaletteHash=*/ true); + QApplicationPrivate::setPalette_helper(palette, className); } diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 8751cc772b..71f695cc18 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -185,7 +185,7 @@ public: static bool widgetCount; // Coupled with -widgetcount switch static void setSystemPalette(const QPalette &pal); - static void setPalette_helper(const QPalette &palette, const char* className, bool clearWidgetPaletteHash); + static void setPalette_helper(const QPalette &palette, const char* className); static void initializeWidgetPaletteHash(); static void initializeWidgetFontHash(); static void setSystemFont(const QFont &font); -- cgit v1.2.3