use QLatin1String::size() in qt_setWindowTitle_helperHelper

Change-Id: I0c8193a7c6bf8b5f894da3e20af3c4d23e0b593a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
Joerg Bornemann 2012-09-27 12:33:29 +02:00 committed by The Qt Project
parent 52e6a908bd
commit 0ef459d7a2

View File

@ -5530,17 +5530,15 @@ QString qt_setWindowTitle_helperHelper(const QString &title, const QWidget *widg
return cap;
QLatin1String placeHolder("[*]");
int placeHolderLength = 3; // QLatin1String doesn't have length()
int index = cap.indexOf(placeHolder);
// here the magic begins
while (index != -1) {
index += placeHolderLength;
index += placeHolder.size();
int count = 1;
while (cap.indexOf(placeHolder, index) == index) {
++count;
index += placeHolderLength;
index += placeHolder.size();
}
if (count%2) { // odd number of [*] -> replace last one