use QLatin1String::size() in qt_setWindowTitle_helperHelper
authorJoerg Bornemann <joerg.bornemann@digia.com>
Thu, 27 Sep 2012 10:33:29 +0000 (12:33 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 27 Sep 2012 13:50:23 +0000 (15:50 +0200)
Change-Id: I0c8193a7c6bf8b5f894da3e20af3c4d23e0b593a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
src/widgets/kernel/qwidget.cpp

index b74cdea..84bb5a6 100644 (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