Add warning for malformed logging rule

Change-Id: I58ccbb77e5ab62e4114a271f199797dd1307a676
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
Tasuku Suzuki 2015-07-10 14:44:48 +09:00 committed by Kai Koehne
parent 0dd14aaaf1
commit fa22138afd

View File

@ -210,8 +210,8 @@ void QLoggingSettingsParser::setContent(QTextStream &stream)
if (_section == QLatin1String("Rules")) { if (_section == QLatin1String("Rules")) {
int equalPos = line.indexOf(QLatin1Char('=')); int equalPos = line.indexOf(QLatin1Char('='));
if ((equalPos != -1) if (equalPos != -1) {
&& (line.lastIndexOf(QLatin1Char('=')) == equalPos)) { if (line.lastIndexOf(QLatin1Char('=')) == equalPos) {
const QStringRef pattern = line.leftRef(equalPos); const QStringRef pattern = line.leftRef(equalPos);
const QStringRef valueStr = line.midRef(equalPos + 1); const QStringRef valueStr = line.midRef(equalPos + 1);
int value = -1; int value = -1;
@ -224,6 +224,9 @@ void QLoggingSettingsParser::setContent(QTextStream &stream)
_rules.append(rule); _rules.append(rule);
else else
warnMsg("Ignoring malformed logging rule: '%s'", line.toUtf8().constData()); warnMsg("Ignoring malformed logging rule: '%s'", line.toUtf8().constData());
} else {
warnMsg("Ignoring malformed logging rule: '%s'", line.toUtf8().constData());
}
} }
} }
} }