From 48eade763a5800e4a8c664ee44b551a6141a40a9 Mon Sep 17 00:00:00 2001 From: Alexandru Ionut Tripon Date: Tue, 3 Feb 2026 12:44:11 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Octol1ttle Signed-off-by: Alexandru Ionut Tripon --- launcher/ui/widgets/InfoFrame.cpp | 13 +++++++------ launcher/ui/widgets/InfoFrame.h | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/launcher/ui/widgets/InfoFrame.cpp b/launcher/ui/widgets/InfoFrame.cpp index fcc5e817c..354211439 100644 --- a/launcher/ui/widgets/InfoFrame.cpp +++ b/launcher/ui/widgets/InfoFrame.cpp @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -75,7 +76,7 @@ InfoFrame::~InfoFrame() delete ui; } -void InfoFrame::updateWithMod(Mod const& m) +void InfoFrame::updateWithMod(const Mod& m) { if (m.type() == ResourceType::FOLDER) { clear(); @@ -182,10 +183,10 @@ QString InfoFrame::renderColorCodes(QString input) while (it != input.constEnd()) { // is current char § and is there a following char if (*it == u'§' && (it + 1) != input.constEnd()) { - auto const& code = *(++it); // incrementing here! + const auto& code = *(++it); // incrementing here! - auto const color_entry = color_codes_map.constFind(code); - auto const tag_entry = formatting_codes_map.constFind(code); + const auto color_entry = color_codes_map.constFind(code); + const auto tag_entry = formatting_codes_map.constFind(code); if (color_entry != color_codes_map.constEnd()) { // color code html += QString("").arg(color_entry.value()); @@ -270,7 +271,7 @@ void InfoFrame::updateHiddenState() void InfoFrame::setName(QString text) { - resetScrolll(); + resetScroll(); if (text.isEmpty()) { ui->nameLabel->setHidden(true); } else { @@ -421,7 +422,7 @@ void InfoFrame::boxClosed([[maybe_unused]] int result) m_current_box = nullptr; } -void InfoFrame::resetScrolll() +void InfoFrame::resetScroll() { ui->scrollArea->horizontalScrollBar()->setValue(0); ui->scrollArea->verticalScrollBar()->setValue(0); diff --git a/launcher/ui/widgets/InfoFrame.h b/launcher/ui/widgets/InfoFrame.h index 8d010c678..b2c867cce 100644 --- a/launcher/ui/widgets/InfoFrame.h +++ b/launcher/ui/widgets/InfoFrame.h @@ -76,7 +76,7 @@ class InfoFrame : public QFrame { private: void updateHiddenState(); - void resetScrolll(); + void resetScroll(); private: Ui::InfoFrame* ui;