1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +01:00

Code cleanup

This commit is contained in:
Martin Tůma 2024-04-14 22:15:30 +02:00
parent 90395a32dd
commit 6f029d81a0

View File

@ -48,12 +48,19 @@ static bool isAllUpperCase(const QString &str)
static QString capitalized(const QString &str)
{
QString ret(str);
for (int i = 0; i < str.size(); i++)
if (i && !(str.at(i-1).isSpace() || str.at(i-1) == '('))
ret[i] = str.at(i).toLower();
QString ret;
ret.resize(str.size());
for (int i = 0; i < str.size(); i++) {
QChar last(str.at(i-1));
QChar current(str.at(i));
if (i && !(last.isSpace() || last == '('))
ret[i] = current.toLower();
else
ret[i] = str.at(i);
ret[i] = current;
}
return ret;
}