fixing a bug in the getLyricList command and clear on lyric edits

This commit is contained in:
Chris Cochrun 2022-09-07 14:30:19 -05:00
parent 8cae86aeba
commit 4954f108a6
2 changed files with 16 additions and 3 deletions

View file

@ -158,7 +158,7 @@ QStringList SongSqlModel::getLyricList(const int &row) {
}
QStringList rawLyrics = recordData.value("lyrics").toString().split("\n");
qDebug() << rawLyrics;
qDebug() << "HERE ARE RAW LYRICS: " << rawLyrics;
QStringList lyrics;
QStringList vorder = recordData.value("vorder").toString().split(" ");
@ -194,7 +194,7 @@ QStringList SongSqlModel::getLyricList(const int &row) {
// qDebug() << line;
if (verse.contains("\n\n")) {
verse = verse.trimmed();
// qDebug() << "THIS IS A EMPTY SLIDE!" << verse;
qDebug() << "THIS IS A EMPTY SLIDE!" << verse;
QStringList multiverses = verse.split("\n\n");
foreach (verse, multiverses) {
verses.insert(vtitle, verse);
@ -211,6 +211,19 @@ QStringList SongSqlModel::getLyricList(const int &row) {
continue;
} else if (rawLyrics.endsWith(line)) {
// qDebug() << vtitle;
verse.append(line.trimmed() + "\n");
if (verse.contains("\n\n")) {
verse = verse.trimmed();
qDebug() << "THIS IS A EMPTY SLIDE!" << verse;
QStringList multiverses = verse.split("\n\n");
foreach (verse, multiverses) {
verses.insert(vtitle, verse);
// qDebug() << verse;
}
break;
}
verse.append(line.trimmed() + "\n");
verses.insert(vtitle, verse);
break;