Commit fd07aed2 authored by Laurent Montel's avatar Laurent Montel 😁

Try to fix off status

parent e99c561b
......@@ -157,6 +157,16 @@ void LoadCategoriesJobTest::shouldReadRules()
QCOMPARE(job.foundOverrideRule(), foundoverriderules);
QCOMPARE(job.qtKdeCategories().count(), qtkdecategories.count());
Q_FOREACH(const LoggingCategory &cat, job.qtKdeCategories()) {
qDebug() << " cat." << cat.description << " logname" << cat.logName << " enabled " << cat.enabled << "type "<<cat.loggingType;
}
qDebug() << "AFTER";
Q_FOREACH(const LoggingCategory &cat, qtkdecategories) {
qDebug() << " cat." << cat.description << " logname" << cat.logName << " enabled " << cat.enabled << "type "<<cat.loggingType;
}
qDebug()<<" job.qtKdeCategories()"<<job.qtKdeCategories().count();
QCOMPARE(job.qtKdeCategories(), qtkdecategories);
}
......
......@@ -125,6 +125,7 @@ KDebugSettingsUtil::LoadLoggingCategory KDebugSettingsUtil::parseLineLoggingQtCa
if (valueStr == QLatin1String("true")) {
cat.enabled = true;
} else {
//cat.type = LoadLoggingCategory::Off;
cat.enabled = false;
}
QString p;
......@@ -146,8 +147,8 @@ KDebugSettingsUtil::LoadLoggingCategory KDebugSettingsUtil::parseLineLoggingQtCa
cat.logName = p;
} else {
p = pattern;
cat.logName = p;
cat.type = LoadLoggingCategory::All;
cat.logName = p;
}
} else {
cat.enabled = false;
......@@ -188,10 +189,11 @@ LoggingCategory::List KDebugSettingsUtil::readLoggingQtCategories(const QString
if (rulesSections) {
const KDebugSettingsUtil::LoadLoggingCategory cat = parseLineLoggingQtCategory(line);
if (cat.isValid() && cat.enabled) {
if (cat.isValid()) {
KDebugSettingsUtil::LoadLoggingCategory nextCat = hashLoadLoggingCategories.value(cat.logName);
if (nextCat.isValid()) {
nextCat.type |= cat.type;
nextCat.enabled = cat.enabled;
hashLoadLoggingCategories[cat.logName] = nextCat;
} else {
hashLoadLoggingCategories.insert(cat.logName, cat);
......@@ -212,7 +214,12 @@ LoggingCategory::List KDebugSettingsUtil::readLoggingQtCategories(const QString
(value.type & LoadLoggingCategory::Info) &&
(value.type & LoadLoggingCategory::Warning) &&
(value.type & LoadLoggingCategory::Critical)) {
cat.loggingType = LoggingCategory::All;
qDebug()<<" cat.enabled "<< cat.enabled;
if (cat.enabled) {
cat.loggingType = LoggingCategory::All;
} else {
cat.loggingType = LoggingCategory::Off;
}
} else if ((value.type & LoadLoggingCategory::Debug) &&
(value.type & LoadLoggingCategory::Warning) &&
(value.type & LoadLoggingCategory::Critical)) {
......
......@@ -39,11 +39,12 @@ struct LoadLoggingCategory {
enum LogType {
Unknown = 1,
Info = 2,
Warning = 4,
Debug = 8,
Critical = 16,
All = 32
Off = 2,
Info = 4,
Warning = 8,
Debug = 16,
Critical = 32,
All = 64
};
Q_FLAGS(LogTypes)
Q_DECLARE_FLAGS(LogTypes, LogType)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment