Apply suggestions from code review

Co-authored-by: Octol1ttle <l1ttleofficial@outlook.com>
Signed-off-by: Alexandru Ionut Tripon <alexandru.tripon97@gmail.com>
This commit is contained in:
Alexandru Ionut Tripon 2026-02-03 12:44:11 +02:00 committed by Trial97
parent eb15897b1a
commit 48eade763a
No known key found for this signature in database
GPG key ID: 55EF5DA53DB36318
2 changed files with 8 additions and 7 deletions

View file

@ -36,6 +36,7 @@
#include <QLabel>
#include <QMessageBox>
#include <QScrollBar>
#include <QTextCursor>
#include <QTextDocument>
#include <QToolTip>
@ -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("<span style=\"color: %1;\">").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);