Changeset View
Changeset View
Standalone View
Standalone View
src/core/kconfig.cpp
Show First 20 Lines • Show All 194 Lines • ▼ Show 20 Line(s) | 192 | if (fs) { | |||
---|---|---|---|---|---|
195 | pclose(fs); | 195 | pclose(fs); | ||
196 | } | 196 | } | ||
197 | #endif | 197 | #endif | ||
198 | aValue.replace(nDollarPos, nEndPos - nDollarPos, result); | 198 | aValue.replace(nDollarPos, nEndPos - nDollarPos, result); | ||
199 | nDollarPos += result.length(); | 199 | nDollarPos += result.length(); | ||
200 | } else if (aValue[nDollarPos + 1] != QLatin1Char('$')) { | 200 | } else if (aValue[nDollarPos + 1] != QLatin1Char('$')) { | ||
201 | int nEndPos = nDollarPos + 1; | 201 | int nEndPos = nDollarPos + 1; | ||
202 | // the next character is not $ | 202 | // the next character is not $ | ||
203 | QString aVarName; | 203 | QStringRef aVarName; | ||
204 | if (aValue[nEndPos] == QLatin1Char('{')) { | 204 | if (aValue[nEndPos] == QLatin1Char('{')) { | ||
205 | while ((nEndPos <= aValue.length()) && (aValue[nEndPos] != QLatin1Char('}'))) { | 205 | while ((nEndPos <= aValue.length()) && (aValue[nEndPos] != QLatin1Char('}'))) { | ||
206 | nEndPos++; | 206 | nEndPos++; | ||
207 | } | 207 | } | ||
208 | nEndPos++; | 208 | nEndPos++; | ||
209 | aVarName = aValue.mid(nDollarPos + 2, nEndPos - nDollarPos - 3); | 209 | aVarName = aValue.midRef(nDollarPos + 2, nEndPos - nDollarPos - 3); | ||
210 | } else { | 210 | } else { | ||
211 | while (nEndPos <= aValue.length() && | 211 | while (nEndPos <= aValue.length() && | ||
212 | (aValue[nEndPos].isNumber() || | 212 | (aValue[nEndPos].isNumber() || | ||
213 | aValue[nEndPos].isLetter() || | 213 | aValue[nEndPos].isLetter() || | ||
214 | aValue[nEndPos] == QLatin1Char('_'))) { | 214 | aValue[nEndPos] == QLatin1Char('_'))) { | ||
215 | nEndPos++; | 215 | nEndPos++; | ||
216 | } | 216 | } | ||
217 | aVarName = aValue.mid(nDollarPos + 1, nEndPos - nDollarPos - 1); | 217 | aVarName = aValue.midRef(nDollarPos + 1, nEndPos - nDollarPos - 1); | ||
218 | } | 218 | } | ||
219 | QString env; | 219 | QString env; | ||
220 | if (!aVarName.isEmpty()) { | 220 | if (!aVarName.isEmpty()) { | ||
221 | #ifdef Q_OS_WIN | 221 | #ifdef Q_OS_WIN | ||
222 | if (aVarName == QLatin1String("HOME")) { | 222 | if (aVarName == QLatin1String("HOME")) { | ||
223 | env = QDir::homePath(); | 223 | env = QDir::homePath(); | ||
224 | } else | 224 | } else | ||
225 | #endif | 225 | #endif | ||
▲ Show 20 Lines • Show All 779 Lines • Show Last 20 Lines |