diff options
author | robotbrainify <robotbrainify@gmail.com> | 2013-10-11 17:54:58 -0400 |
---|---|---|
committer | robotbrainify <robotbrainify@gmail.com> | 2013-10-11 17:54:58 -0400 |
commit | 4d320e8fc9997ec54ba53c44bd8607399a2c4476 (patch) | |
tree | f22cd48801da2055e131c354779a8bf506b8404f | |
parent | f8b4c2c0b25f89017db2702b60d47df7376b32e6 (diff) | |
download | MultiMC-4d320e8fc9997ec54ba53c44bd8607399a2c4476.tar MultiMC-4d320e8fc9997ec54ba53c44bd8607399a2c4476.tar.gz MultiMC-4d320e8fc9997ec54ba53c44bd8607399a2c4476.tar.lz MultiMC-4d320e8fc9997ec54ba53c44bd8607399a2c4476.tar.xz MultiMC-4d320e8fc9997ec54ba53c44bd8607399a2c4476.zip |
remove dupe newlines from trimmed mod description. whoo
-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 { |