fix: expand tilde in lyrics path

Fixes #1532
This commit is contained in:
2 * r + 2 * t 2026-06-09 16:10:35 +10:00
parent 4684e8a24f
commit 63b522648e

View file

@ -855,6 +855,11 @@ QString Lyrics::lyricsDir() const {
if (dir.isEmpty()) { if (dir.isEmpty()) {
return {}; return {};
} }
if (dir == u"~"_s) {
dir = QDir::homePath();
} else if (dir.startsWith(u"~/"_s)) {
dir.replace(0, 1, QDir::homePath());
}
while (dir.endsWith(QLatin1Char('/')) && dir.size() > 1) { while (dir.endsWith(QLatin1Char('/')) && dir.size() > 1) {
dir.chop(1); dir.chop(1);
} }