Skip to content

Commit

Permalink
Modify code to match clang-tidy linter
Browse files Browse the repository at this point in the history
  • Loading branch information
AdenKoperczak committed Nov 29, 2024
1 parent 1780041 commit 1aea458
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
4 changes: 2 additions & 2 deletions scwx-qt/source/scwx/qt/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ static void ConfigureTheme(const std::vector<std::string>& 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)
Expand Down
11 changes: 2 additions & 9 deletions scwx-qt/source/scwx/qt/util/qt6ct_palette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@
#include <QSettings>
#include <QPalette>

namespace scwx
{
namespace qt
{
namespace util
{
namespace scwx::qt::util {

QPalette loadColorScheme(const QString& filePath, const QPalette& fallback)
{
Expand Down Expand Up @@ -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(
Expand All @@ -85,5 +80,3 @@ QPalette loadColorScheme(const QString& filePath, const QPalette& fallback)
}

} // namespace util
} // namespace qt
} // namespace scwx
10 changes: 2 additions & 8 deletions scwx-qt/source/scwx/qt/util/qt6ct_palette.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

#include <QPalette>

namespace scwx
{
namespace qt
{
namespace util
namespace scwx::qt::util
{

/**
Expand All @@ -20,6 +16,4 @@ namespace util
*/
QPalette loadColorScheme(const QString& filePath, const QPalette& fallback);

} // namespace util
} // namespace qt
} // namespace scwx
}

0 comments on commit 1aea458

Please sign in to comment.