Commit 8ba1ee90 authored by Laurent Montel's avatar Laurent Montel 😁

Generate custom rules

parent 3475a7a2
......@@ -56,7 +56,7 @@ void ConfigureCustomSettingWidgetTest::shouldHaveDefaultValue()
QVERIFY(lab);
QComboBox *categoryType = w.findChild<QComboBox *>(QStringLiteral("categorytype_combobox"));
QVERIFY(categoryType);
QCOMPARE(categoryType->count(), 5);
QCOMPARE(categoryType->count(), 4);
}
void ConfigureCustomSettingWidgetTest::shouldRestoreRules_data()
......
......@@ -84,19 +84,32 @@ void ConfigureCustomSettingWidget::setRule(const QString &rule)
QString ConfigureCustomSettingWidget::rule() const
{
QString ruleStr = mCategoryLineEdit->text().trimmed();
#if 0 //FIXME
if (!ruleStr.isEmpty()) {
const QString type = mCategoryType->type();
if (!type.isEmpty()) {
ruleStr += QLatin1Char('.') + type;
switch(mCategoryType->type()) {
case LoggingCategory::All:
break;
case LoggingCategory::Info:
ruleStr += QStringLiteral(".info");
break;
case LoggingCategory::Warning:
ruleStr += QStringLiteral(".warning");
break;
case LoggingCategory::Debug:
ruleStr += QStringLiteral(".debug");
break;
case LoggingCategory::Critical:
ruleStr += QStringLiteral(".critical");
break;
case LoggingCategory::Off:
break;
}
if (mEnableCategory->isChecked()) {
ruleStr += QStringLiteral("=true");
} else {
ruleStr += QStringLiteral("=false");
}
}
#endif
return ruleStr;
}
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