avoid multiple spaces in property name

This commit is contained in:
wmayer
2018-10-03 18:48:10 +02:00
parent e2ddabf235
commit 8bf9d368a4

View File

@@ -373,8 +373,11 @@ void PropertyItem::setPropertyName(const QString& name)
for (int i=0; i<name.length(); i++) {
if (name[i].isUpper() && !display.isEmpty()) {
// if there is a sequence of capital letters do not insert spaces
if (!upper)
display += QLatin1String(" ");
if (!upper) {
QChar last = display.at(display.length()-1);
if (!last.isSpace())
display += QLatin1String(" ");
}
}
upper = name[i].isUpper();
display += name[i];