summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-19 11:29:24 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-19 11:29:24 (GMT)
commitbb1536706b96d9853e67961842c1d12b44523f38 (patch)
tree30a37e2e7d6360959fd7468215eebc0746c61418
parent8be2e4d05cd5fd56d5edd5f340e268d0d31cf5b6 (diff)
Allow to use renamed categories
-rw-r--r--src/kdebugsettingsdialog.cpp1
-rw-r--r--src/loadcategoriesjob.cpp16
2 files changed, 15 insertions, 2 deletions
diff --git a/src/kdebugsettingsdialog.cpp b/src/kdebugsettingsdialog.cpp
index de40b58..e097448 100644
--- a/src/kdebugsettingsdialog.cpp
+++ b/src/kdebugsettingsdialog.cpp
@@ -179,6 +179,7 @@ void KDebugSettingsDialog::readCategoriesFiles(const QString &path)
LoadCategoriesJob job;
job.setFileName(path);
job.setCategories(mCategoriesList);
+ job.setRenamedCategories(mRenameCategoriesList);
job.start();
const LoggingCategory::List customCategories = job.customCategories();
diff --git a/src/loadcategoriesjob.cpp b/src/loadcategoriesjob.cpp
index 58edf1d..efdffdf 100644
--- a/src/loadcategoriesjob.cpp
+++ b/src/loadcategoriesjob.cpp
@@ -104,11 +104,23 @@ void LoadCategoriesJob::start()
mQtKdeCategories.clear();
mFoundOverrideRule = false;
const int number(mCategories.count());
- QList<KDebugSettingsUtil::LoadLoggingCategory> qtCategories = KDebugSettingsUtil::readLoggingQtCategories(mFileName);
+ const QList<KDebugSettingsUtil::LoadLoggingCategory> originalQtCategories = KDebugSettingsUtil::readLoggingQtCategories(mFileName);
+ QList<KDebugSettingsUtil::LoadLoggingCategory> qtCategories;
+ Q_FOREACH (KDebugSettingsUtil::LoadLoggingCategory cat, originalQtCategories) {
+ Q_FOREACH(const RenameCategory &catRenamed, mRenameCategories) {
+ if (cat.logName == catRenamed.originalName) {
+ cat.logName = catRenamed.newName;
+ break;
+ }
+ }
+ qtCategories.append(cat);
+ }
+
for (int i = 0; i < number; ++i) {
KdeLoggingCategory kdeCat = mCategories.at(i);
+
bool foundInConfigFile = false;
- Q_FOREACH (const KDebugSettingsUtil::LoadLoggingCategory &cat, qtCategories) {
+ Q_FOREACH (KDebugSettingsUtil::LoadLoggingCategory cat, qtCategories) {
if (cat.logName == kdeCat.logName) {
LoggingCategory tmp;