mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 09:59:59 +03:00
remove dupe newlines from trimmed mod description. whoo
This commit is contained in:
parent
f8b4c2c0b2
commit
4d320e8fc9
2 changed files with 15 additions and 1 deletions
|
|
@ -69,5 +69,18 @@ void MCModInfoFrame::setModText(QString text)
|
|||
|
||||
void MCModInfoFrame::setModDescription(QString text)
|
||||
{
|
||||
ui->label_ModDescription->setText(text);
|
||||
QString intermediatetext = text.trimmed();
|
||||
bool prev(false);
|
||||
QChar rem('\n');
|
||||
QString finaltext;
|
||||
finaltext.reserve(intermediatetext.size());
|
||||
foreach(const QChar& c, intermediatetext)
|
||||
{
|
||||
if(c == rem && prev){
|
||||
continue;
|
||||
}
|
||||
prev = c == rem;
|
||||
finaltext += c;
|
||||
}
|
||||
ui->label_ModDescription->setText(finaltext);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue