diff options
-rw-r--r-- | gui/MCModInfoFrame.cpp | 15 | ||||
-rw-r--r-- | gui/MCModInfoFrame.h | 1 |
2 files changed, 15 insertions, 1 deletions
diff --git a/gui/MCModInfoFrame.cpp b/gui/MCModInfoFrame.cpp index 51651e33..22a53819 100644 --- a/gui/MCModInfoFrame.cpp +++ b/gui/MCModInfoFrame.cpp @@ -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); } diff --git a/gui/MCModInfoFrame.h b/gui/MCModInfoFrame.h index cdf399cb..bc10ae6a 100644 --- a/gui/MCModInfoFrame.h +++ b/gui/MCModInfoFrame.h @@ -17,6 +17,7 @@ #include <QFrame> #include "logic/Mod.h" +#include <stdio.h> namespace Ui { |