diff options
author | Kai Koehne <kai.koehne@digia.com> | 2014-02-24 14:20:44 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-26 12:58:00 +0100 |
commit | f3ed93e4862a1384cf176b17675cfa78cbbeef74 (patch) | |
tree | f44485d40f336918beae659ae21a8dabec2f7645 | |
parent | 5ce87f07821257891ee66d4d3232f1e010f8c171 (diff) |
Logging: Change 'rules' section name to 'Rules'
This is more consistent with e.g. qt.conf, where section names also
start with an upper case character.
Change-Id: I9ddaf72baeb9334d081807412512242d5d46cbbf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
-rw-r--r-- | src/corelib/io/qloggingcategory.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qloggingregistry.cpp | 4 | ||||
-rw-r--r-- | tests/auto/corelib/io/qloggingregistry/qtlogging.ini | 2 | ||||
-rw-r--r-- | tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp | 10 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp index f37b9575aa..eb8aeaca50 100644 --- a/src/corelib/io/qloggingcategory.cpp +++ b/src/corelib/io/qloggingcategory.cpp @@ -109,7 +109,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QLoggingCategory, qtDefaultCategory, apply to a category/type, the rule that comes later is applied. Rules can be set via \l setFilterRules(). Since Qt 5.3 logging rules - are also automatically loaded from the \c [rules] section of a logging + are also automatically loaded from the \c [Rules] section of a logging configuration file. Such configuration files are looked up in the QtProject configuration directory, or explicitly set in a \c QT_LOGGING_CONF environment variable. diff --git a/src/corelib/io/qloggingregistry.cpp b/src/corelib/io/qloggingregistry.cpp index b8fef16c0e..2619743ff4 100644 --- a/src/corelib/io/qloggingregistry.cpp +++ b/src/corelib/io/qloggingregistry.cpp @@ -203,7 +203,7 @@ void QLoggingSettingsParser::setContent(QTextStream &stream) continue; } - if (_section == QLatin1String("rules")) { + if (_section == QLatin1String("Rules")) { int equalPos = line.indexOf(QLatin1Char('=')); if ((equalPos != -1) && (line.lastIndexOf(QLatin1Char('=')) == equalPos)) { @@ -298,7 +298,7 @@ void QLoggingRegistry::unregisterCategory(QLoggingCategory *cat) void QLoggingRegistry::setApiRules(const QString &content) { QLoggingSettingsParser parser; - parser.setSection(QStringLiteral("rules")); + parser.setSection(QStringLiteral("Rules")); parser.setContent(content); QMutexLocker locker(®istryMutex); diff --git a/tests/auto/corelib/io/qloggingregistry/qtlogging.ini b/tests/auto/corelib/io/qloggingregistry/qtlogging.ini index 63b384e36a..fd7a4f8c54 100644 --- a/tests/auto/corelib/io/qloggingregistry/qtlogging.ini +++ b/tests/auto/corelib/io/qloggingregistry/qtlogging.ini @@ -1,2 +1,2 @@ -[rules] +[Rules] *=true diff --git a/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp b/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp index b538525161..dc6f16828b 100644 --- a/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp +++ b/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp @@ -63,16 +63,16 @@ private slots: { // // Logging configuration can be described - // in an .ini file. [rules] is the + // in an .ini file. [Rules] is the // default category, and optional ... // QLoggingSettingsParser parser; - parser.setContent("[rules]\n" + parser.setContent("[Rules]\n" "default=false\n" "default=true"); QCOMPARE(parser.rules().size(), 2); - parser.setContent("[rules]\n" + parser.setContent("[Rules]\n" "default=false"); QCOMPARE(parser.rules().size(), 1); @@ -115,7 +115,7 @@ private slots: QFile file(dir.absoluteFilePath("qtlogging.ini")); QVERIFY(file.open(QFile::WriteOnly | QFile::Text)); QTextStream out(&file); - out << "[rules]\n"; + out << "[Rules]\n"; out << "Digia.*=false\n"; file.close(); @@ -153,7 +153,7 @@ private slots: // set Config rule QLoggingSettingsParser parser; - parser.setContent("[rules]\nDigia.*=false"); + parser.setContent("[Rules]\nDigia.*=false"); registry->configRules=parser.rules(); registry->updateRules(); |