mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 11:45:53 +01:00
Code cleanup
This commit is contained in:
parent
90395a32dd
commit
6f029d81a0
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user