aboutsummaryrefslogtreecommitdiff
path: root/src/kconf_update/kconf_update.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kconf_update/kconf_update.cpp')
-rw-r--r--src/kconf_update/kconf_update.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/kconf_update/kconf_update.cpp b/src/kconf_update/kconf_update.cpp
index 8cbbc3c3..0e9744a0 100644
--- a/src/kconf_update/kconf_update.cpp
+++ b/src/kconf_update/kconf_update.cpp
@@ -35,6 +35,11 @@
// the file.
#define qCDebugFile(CATEGORY) qCDebug(CATEGORY) << m_currentFilename << ':' << m_lineCount << ":'" << m_line << "': "
+static bool caseInsensitiveCompare(const QStringView &a, const QLatin1String &b)
+{
+ return a.compare(b, Qt::CaseInsensitive) == 0;
+}
+
class KonfUpdate
{
public:
@@ -701,11 +706,11 @@ void KonfUpdate::gotOptions(const QString &_options)
{
const QStringList options = _options.split(QLatin1Char{','});
for (const auto &opt : options) {
- const auto normalizedOpt = opt.toLower().trimmed();
+ const auto normalizedOpt = QStringView(opt).trimmed();
- if (normalizedOpt == QLatin1String("copy")) {
+ if (caseInsensitiveCompare(normalizedOpt, QLatin1String("copy"))) {
m_bCopy = true;
- } else if (normalizedOpt == QLatin1String("overwrite")) {
+ } else if (caseInsensitiveCompare(normalizedOpt, QLatin1String("overwrite"))) {
m_bOverwrite = true;
}
}