diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/bufferfragment_p.h | 8 | ||||
-rw-r--r-- | src/core/kconfig.cpp | 8 | ||||
-rw-r--r-- | src/core/kconfigini.cpp | 19 |
3 files changed, 18 insertions, 17 deletions
diff --git a/src/core/bufferfragment_p.h b/src/core/bufferfragment_p.h index ba100ef7..3edbb6b6 100644 --- a/src/core/bufferfragment_p.h +++ b/src/core/bufferfragment_p.h @@ -64,11 +64,11 @@ public: void trim() { while (bf_isspace(*d) && len > 0) { - d++; - len--; + ++d; + --len; } while (len > 0 && bf_isspace(d[len - 1])) { - len--; + --len; } } @@ -160,7 +160,7 @@ public: if (d[from] == c) { return from; } else { - from--; + --from; } return -1; } diff --git a/src/core/kconfig.cpp b/src/core/kconfig.cpp index 04608b0d..ed389ea3 100644 --- a/src/core/kconfig.cpp +++ b/src/core/kconfig.cpp @@ -177,16 +177,16 @@ QString KConfigPrivate::expandString(const QString &value) QStringRef aVarName; if (aValue[nEndPos] == QLatin1Char('{')) { while ((nEndPos <= aValue.length()) && (aValue[nEndPos] != QLatin1Char('}'))) { - nEndPos++; + ++nEndPos; } - nEndPos++; + ++nEndPos; aVarName = aValue.midRef(nDollarPos + 2, nEndPos - nDollarPos - 3); } else { while (nEndPos < aValue.length() && (aValue[nEndPos].isNumber() || aValue[nEndPos].isLetter() || aValue[nEndPos] == QLatin1Char('_'))) { - nEndPos++; + ++nEndPos; } aVarName = aValue.midRef(nDollarPos + 1, nEndPos - nDollarPos - 1); } @@ -219,7 +219,7 @@ QString KConfigPrivate::expandString(const QString &value) } else { // remove one of the dollar signs aValue.remove(nDollarPos, 1); - nDollarPos++; + ++nDollarPos; } nDollarPos = aValue.indexOf(QLatin1Char('$'), nDollarPos); } diff --git a/src/core/kconfigini.cpp b/src/core/kconfigini.cpp index b5f40373..96cd3763 100644 --- a/src/core/kconfigini.cpp +++ b/src/core/kconfigini.cpp @@ -111,7 +111,7 @@ KConfigIniBackend::parseConfig(const QByteArray ¤tLocale, KEntryMap &entry while (startOfLine < len) { BufferFragment line = contents.split('\n', &startOfLine); line.trim(); - lineNo++; + ++lineNo; // skip empty lines and lines beginning with '#' if (line.isEmpty() || line.at(0) == '#') { @@ -122,7 +122,8 @@ KConfigIniBackend::parseConfig(const QByteArray ¤tLocale, KEntryMap &entry groupOptionImmutable = fileOptionImmutable; QByteArray newGroup; - int start = 1, end; + int start = 1; + int end = 0; do { end = start; for (;;) { @@ -134,7 +135,7 @@ KConfigIniBackend::parseConfig(const QByteArray ¤tLocale, KEntryMap &entry if (line.at(end) == ']') { break; } - end++; + ++end; } if (end + 1 == line.length() && start + 2 == end && line.at(start) == '$' && line.at(start + 1) == 'i') { @@ -224,7 +225,7 @@ KConfigIniBackend::parseConfig(const QByteArray ¤tLocale, KEntryMap &entry default: break; } - i++; + ++i; } } else { // found a locale if (!locale.isNull()) { @@ -333,7 +334,7 @@ void KConfigIniBackend::writeEntries(const QByteArray &locale, QIODevice &file, } } file.write("\\x24"); - start++; + ++start; } nope: file.write(stringToPrintable(currentGroup.mid(start), GroupString)); @@ -758,7 +759,7 @@ QByteArray KConfigIniBackend::stringToPrintable(const QByteArray &aString, Strin if (s[0] == ' ' && type != GroupString) { *data++ = '\\'; *data++ = 's'; - i++; + ++i; } Utf8Char utf8; @@ -869,7 +870,7 @@ void KConfigIniBackend::printableToString(BufferFragment *aString, const QFile & *r = str[i]; } else { // Probable escape sequence - i++; + ++i; if (i >= l) { // Line ends after backslash - stop. *r = '\\'; break; @@ -894,13 +895,13 @@ void KConfigIniBackend::printableToString(BufferFragment *aString, const QFile & case ';': // not really an escape sequence, but allowed in .desktop files, don't strip '\;' from the string *r = '\\'; - r++; + ++r; *r = ';'; break; case ',': // not really an escape sequence, but allowed in .desktop files, don't strip '\,' from the string *r = '\\'; - r++; + ++r; *r = ','; break; case 'x': |