remove dupe newlines from trimmed mod description. whoo
This commit is contained in:
parent
f8b4c2c0b2
commit
4d320e8fc9
@ -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);
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <QFrame>
|
||||
#include "logic/Mod.h"
|
||||
#include <stdio.h>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user