diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2018-05-13 21:53:07 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2018-06-22 20:12:41 +0000 |
commit | cad7100fda1b27ba56c4d9efc6bceba62859dfbc (patch) | |
tree | 942ff836a94aab364ae8c408dcfa44d8808c8134 /src/corelib/io/qsettings.cpp | |
parent | c699daeceb4448c4545a67ffdba27bcb3b994114 (diff) |
QByteArray: add compare() with case sensitivity options
Need to do the same for startsWith() and endsWith(). indexOf() is a lot
harder.
[ChangeLog][QtCore][QByteArray] Added compare(), which takes
Qt::CaseSensitivity as one of the parameters. This function is more
efficient than using toLower() or toUpper() and then comparing.
Change-Id: Ib48364abee9f464c96c6fffd152e69bde4194df7
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/corelib/io/qsettings.cpp')
-rw-r--r-- | src/corelib/io/qsettings.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 4b1b9888d8..1134c6bb85 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -1694,10 +1694,10 @@ bool QConfFileSettingsPrivate::readIniFile(const QByteArray &data, iniSection = iniSection.trimmed(); - if (qstricmp(iniSection.constData(), "general") == 0) { + if (iniSection.compare("general", Qt::CaseInsensitive) == 0) { currentSection.clear(); } else { - if (qstricmp(iniSection.constData(), "%general") == 0) { + if (iniSection.compare("%general", Qt::CaseInsensitive) == 0) { currentSection = QLatin1String(iniSection.constData() + 1); } else { currentSection.clear(); @@ -1857,7 +1857,7 @@ bool QConfFileSettingsPrivate::writeIniFile(QIODevice &device, const ParsedSetti if (realSection.isEmpty()) { realSection = "[General]"; - } else if (qstricmp(realSection.constData(), "general") == 0) { + } else if (realSection.compare("general", Qt::CaseInsensitive) == 0) { realSection = "[%General]"; } else { realSection.prepend('['); |