Commit c5e029675d3074ced51ae50ed8d1544dd3adcd9e

Authored by Charles Otto
1 parent 571e977f

Use QString::simplified to avoid extraneous newlines

QTextStream is apparently somewhat better behaved about these things than
QFile.
Showing 1 changed file with 2 additions and 2 deletions
openbr/plugins/gallery.cpp
@@ -591,7 +591,7 @@ class txtGallery : public Gallery @@ -591,7 +591,7 @@ class txtGallery : public Gallery
591 for (qint64 i = 0; i < readBlockSize; i++) 591 for (qint64 i = 0; i < readBlockSize; i++)
592 { 592 {
593 QByteArray lineBytes = f.readLine(); 593 QByteArray lineBytes = f.readLine();
594 - QString line(lineBytes); 594 + QString line = QString::fromLocal8Bit(lineBytes).simplified();
595 595
596 if (!line.isEmpty()){ 596 if (!line.isEmpty()){
597 int splitIndex = line.lastIndexOf(' '); 597 int splitIndex = line.lastIndexOf(' ');
@@ -655,7 +655,7 @@ class flatGallery : public Gallery @@ -655,7 +655,7 @@ class flatGallery : public Gallery
655 QByteArray line = f.readLine(); 655 QByteArray line = f.readLine();
656 656
657 if (!line.isEmpty()) 657 if (!line.isEmpty())
658 - templates.append(File(QString(line))); 658 + templates.append(File(QString::fromLocal8Bit(line).simplified()));
659 659
660 if (f.atEnd()) { 660 if (f.atEnd()) {
661 *done=true; 661 *done=true;