From 1aea4581770cdac770e7a9c9fb5476eb81be47b5 Mon Sep 17 00:00:00 2001 From: AdenKoperczak Date: Fri, 29 Nov 2024 12:52:41 -0500 Subject: [PATCH] Modify code to match clang-tidy linter --- scwx-qt/source/scwx/qt/main/main.cpp | 4 ++-- scwx-qt/source/scwx/qt/util/qt6ct_palette.cpp | 11 ++--------- scwx-qt/source/scwx/qt/util/qt6ct_palette.hpp | 10 ++-------- 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/scwx-qt/source/scwx/qt/main/main.cpp b/scwx-qt/source/scwx/qt/main/main.cpp index f2cfcdb8..b2a454a6 100644 --- a/scwx-qt/source/scwx/qt/main/main.cpp +++ b/scwx-qt/source/scwx/qt/main/main.cpp @@ -177,8 +177,8 @@ static void ConfigureTheme(const std::vector& args) if (paletteFile) { - QPalette defaultPalette = QApplication::style()->standardPalette(); - QPalette palette = scwx::qt::util::loadColorScheme( + const QPalette defaultPalette = QApplication::style()->standardPalette(); + const QPalette palette = scwx::qt::util::loadColorScheme( QString::fromStdString(*paletteFile), defaultPalette); if (defaultPalette == palette) diff --git a/scwx-qt/source/scwx/qt/util/qt6ct_palette.cpp b/scwx-qt/source/scwx/qt/util/qt6ct_palette.cpp index dc5e1fa4..8c3dd47e 100644 --- a/scwx-qt/source/scwx/qt/util/qt6ct_palette.cpp +++ b/scwx-qt/source/scwx/qt/util/qt6ct_palette.cpp @@ -33,12 +33,7 @@ #include #include -namespace scwx -{ -namespace qt -{ -namespace util -{ +namespace scwx::qt::util { QPalette loadColorScheme(const QString& filePath, const QPalette& fallback) { @@ -67,7 +62,7 @@ QPalette loadColorScheme(const QString& filePath, const QPalette& fallback) { for (int i = 0; i < QPalette::NColorRoles; i++) { - QPalette::ColorRole role = QPalette::ColorRole(i); + auto role = QPalette::ColorRole(i); customPalette.setColor( QPalette::Active, role, QColor(activeColors.at(i))); customPalette.setColor( @@ -85,5 +80,3 @@ QPalette loadColorScheme(const QString& filePath, const QPalette& fallback) } } // namespace util -} // namespace qt -} // namespace scwx diff --git a/scwx-qt/source/scwx/qt/util/qt6ct_palette.hpp b/scwx-qt/source/scwx/qt/util/qt6ct_palette.hpp index 62417f8e..874e5eba 100644 --- a/scwx-qt/source/scwx/qt/util/qt6ct_palette.hpp +++ b/scwx-qt/source/scwx/qt/util/qt6ct_palette.hpp @@ -2,11 +2,7 @@ #include -namespace scwx -{ -namespace qt -{ -namespace util +namespace scwx::qt::util { /** @@ -20,6 +16,4 @@ namespace util */ QPalette loadColorScheme(const QString& filePath, const QPalette& fallback); -} // namespace util -} // namespace qt -} // namespace scwx +}