mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-24 22:34:54 +00:00
Trim extra characters from measured progress
The measured_progress C string for achievements to display potentially contains junk data after the null terminator, which was rendering in the QString in the dialog. This trims those junk characters.
This commit is contained in:
parent
0cc1d4c62d
commit
bf230a9909
1 changed files with 4 additions and 1 deletions
|
@ -4,6 +4,7 @@
|
|||
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||
#include "DolphinQt/Achievements/AchievementBox.h"
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QDateTime>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
|
@ -92,7 +93,9 @@ void AchievementBox::UpdateData()
|
|||
m_progress_bar->setRange(0, 100);
|
||||
m_progress_bar->setValue(m_achievement->measured_percent);
|
||||
m_progress_bar->setTextVisible(false);
|
||||
m_progress_label->setText(QString::fromUtf8(m_achievement->measured_progress, PROGRESS_LENGTH));
|
||||
m_progress_label->setText(
|
||||
QString::fromUtf8(m_achievement->measured_progress,
|
||||
qstrnlen(m_achievement->measured_progress, PROGRESS_LENGTH)));
|
||||
m_progress_bar->setVisible(true);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue