From 2af6e73c59d123bb9cf00fae797b1eb1ea73c296 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Tue, 6 Apr 2010 19:56:58 +0200
Subject: [PATCH] avoid detaching

amazingly enough, qlist::{first,last}() have non-const versions,
which are of course used when you least expect it ...
---
 src/shared/proparser/profileevaluator.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/shared/proparser/profileevaluator.cpp b/src/shared/proparser/profileevaluator.cpp
index 5f733482830..2ad83066a87 100644
--- a/src/shared/proparser/profileevaluator.cpp
+++ b/src/shared/proparser/profileevaluator.cpp
@@ -1800,15 +1800,16 @@ QStringList ProFileEvaluator::Private::expandVariableReferences(
                         appendString(replacement.join(statics.field_sep),
                                      &current, &ptr, &pending);
                     } else {
-                        appendString(replacement.first(), &current, &ptr, &pending);
+                        appendString(replacement.at(0), &current, &ptr, &pending);
                         if (replacement.size() > 1) {
                             flushCurrent(&ret, &current, &ptr, &pending);
-                            pending = replacement.last();
+                            int j = 1;
                             if (replacement.size() > 2) {
                                 // FIXME: ret.reserve(ret.size() + replacement.size() - 2);
-                                for (int i = 1; i < replacement.size() - 1; ++i)
-                                    ret << replacement.at(i);
+                                for (; j < replacement.size() - 1; ++j)
+                                    ret << replacement.at(j);
                             }
+                            pending = replacement.at(j);
                         }
                     }
                     replaced = true;
-- 
GitLab