Introduce helper function to join values as string

PR #20130.
This commit is contained in:
Chocobo1 2023-12-19 00:08:37 +08:00 committed by GitHub
parent 9d90141c29
commit 073ca4267c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 188 additions and 77 deletions

View file

@ -522,10 +522,7 @@ void Application::runExternalProgram(const QString &programTemplate, const BitTo
str.replace(i, 2, torrent->contentPath().toString());
break;
case u'G':
{
const TagSet &tags = torrent->tags();
str.replace(i, 2, QStringList(tags.cbegin(), tags.cend()).join(u","_s));
}
str.replace(i, 2, Utils::String::joinIntoString(torrent->tags(), u","_s));
break;
case u'I':
str.replace(i, 2, (torrent->infoHash().v1().isValid() ? torrent->infoHash().v1().toString() : u"-"_s));