mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
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:
parent
eb15897b1a
commit
48eade763a
2 changed files with 8 additions and 7 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class InfoFrame : public QFrame {
|
|||
|
||||
private:
|
||||
void updateHiddenState();
|
||||
void resetScrolll();
|
||||
void resetScroll();
|
||||
|
||||
private:
|
||||
Ui::InfoFrame* ui;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue