summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobotbrainify <robotbrainify@gmail.com>2013-10-11 17:54:58 -0400
committerrobotbrainify <robotbrainify@gmail.com>2013-10-11 17:54:58 -0400
commit4d320e8fc9997ec54ba53c44bd8607399a2c4476 (patch)
treef22cd48801da2055e131c354779a8bf506b8404f
parentf8b4c2c0b25f89017db2702b60d47df7376b32e6 (diff)
downloadMultiMC-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.cpp15
-rw-r--r--gui/MCModInfoFrame.h1
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
{