1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +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) static QString capitalized(const QString &str)
{ {
QString ret(str); QString ret;
for (int i = 0; i < str.size(); i++)
if (i && !(str.at(i-1).isSpace() || str.at(i-1) == '(')) ret.resize(str.size());
ret[i] = str.at(i).toLower();
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 else
ret[i] = str.at(i); ret[i] = current;
}
return ret; return ret;
} }