Skip to content

Commit

Permalink
Made parameter const
Browse files Browse the repository at this point in the history
  • Loading branch information
dmdmdm authored and hatstand committed May 24, 2020
1 parent 86b48c2 commit 0f2e894
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ext/libclementine-tagreader/tagreader.cpp
Expand Up @@ -137,8 +137,10 @@ QString WithoutExtension(const QString& s) {
return s.left(i);
}

void ReplaceUnderscoresWithSpaces(QString &s) {
s.replace('_', ' ');
QString ReplaceUnderscoresWithSpaces(const QString &s) {
QString ret(s);
ret.replace('_', ' ');
return ret;
}

} // namespace
Expand All @@ -159,8 +161,8 @@ void TagReader::GuessArtistAndTitle(pb::tagreader::SongMetadata *song) const {
title = WithoutExtension(bn);
}

ReplaceUnderscoresWithSpaces(artist);
ReplaceUnderscoresWithSpaces(title);
artist = ReplaceUnderscoresWithSpaces(artist);
title = ReplaceUnderscoresWithSpaces(title);
artist = artist.trimmed();
title = title.trimmed();
if (!artist.isEmpty()) { song->set_artist(artist.toUtf8().data()); }
Expand Down

0 comments on commit 0f2e894

Please sign in to comment.