Commit 08bb5ade authored by Laurent Montel's avatar Laurent Montel 😁

Astyle kdelibs

parent 8540c2a5
......@@ -82,7 +82,7 @@ void KDebugSettingUtilTest::shouldParseQtLoggingLine_data()
QTest::newRow("validenabledwithtypedebug") << QStringLiteral("toto.debug=true") << QStringLiteral("toto") << KDebugSettingsUtil::LoadLoggingCategory::Debug << true << true;
QTest::newRow("invalid") << QStringLiteral("dd") << QString() << KDebugSettingsUtil::LoadLoggingCategory::Unknown << false << false;
QTest::newRow("invalidWithoutEnabledDisabled") << QStringLiteral("dd=")<< QStringLiteral("dd") << KDebugSettingsUtil::LoadLoggingCategory::All << false << true;
QTest::newRow("invalidWithoutEnabledDisabled") << QStringLiteral("dd=") << QStringLiteral("dd") << KDebugSettingsUtil::LoadLoggingCategory::All << false << true;
}
void KDebugSettingUtilTest::shouldParseQtLoggingLine()
......
......@@ -94,7 +94,6 @@ void LoadCategoriesJobTest::shouldReadRules_data()
<< LoggingCategory::List()
<< qtKdeCategories;
qtKdeCategories.clear();
tmp.description = QStringLiteral("KPasswdServer (KIO)");
tmp.logName = QStringLiteral("org.kde.kio.kpasswdserver");
......@@ -126,7 +125,6 @@ void LoadCategoriesJobTest::shouldReadRules_data()
tmp.enabled = true;
qtKdeCategories.append(tmp);
QTest::newRow("oneelementoff") << QStringLiteral("oneelementoff.ini") << QStringLiteral("correct.categories") << false
<< LoggingCategory::List()
<< qtKdeCategories;
......@@ -135,7 +133,6 @@ void LoadCategoriesJobTest::shouldReadRules_data()
<< LoggingCategory::List()
<< qtKdeCategories;
qtKdeCategories.clear();
tmp.description = QStringLiteral("KPasswdServer (KIO)");
tmp.logName = QStringLiteral("org.kde.kio.kpasswdserver");
......@@ -167,7 +164,6 @@ void LoadCategoriesJobTest::shouldReadRules_data()
tmp.enabled = true;
qtKdeCategories.append(tmp);
QTest::newRow("oneelementall") << QStringLiteral("oneelementall.ini") << QStringLiteral("correct.categories") << false
<< LoggingCategory::List()
<< qtKdeCategories;
......@@ -207,7 +203,6 @@ void LoadCategoriesJobTest::shouldReadRules_data()
tmp.enabled = true;
qtKdeCategories.append(tmp);
QTest::newRow("oneelementinfo") << QStringLiteral("oneelementinfo.ini") << QStringLiteral("correct.categories") << false
<< LoggingCategory::List()
<< qtKdeCategories;
......@@ -247,7 +242,6 @@ void LoadCategoriesJobTest::shouldReadRules_data()
tmp.enabled = true;
qtKdeCategories.append(tmp);
QTest::newRow("oneelementwarning") << QStringLiteral("oneelementwarning.ini") << QStringLiteral("correct.categories") << false
<< LoggingCategory::List()
<< qtKdeCategories;
......@@ -283,7 +277,6 @@ void LoadCategoriesJobTest::shouldReadRules_data()
tmp.enabled = true;
qtKdeCategories.append(tmp);
QTest::newRow("oneelementcritical") << QStringLiteral("oneelementcritical.ini") << QStringLiteral("correct.categories") << false
<< LoggingCategory::List()
<< qtKdeCategories;
......@@ -295,7 +288,6 @@ void LoadCategoriesJobTest::shouldReadRules_data()
<< LoggingCategory::List()
<< qtKdeCategories;
qtKdeCategories.clear();
tmp.description = QStringLiteral("KPasswdServer (KIO)");
tmp.logName = QStringLiteral("org.kde.kio.kpasswdserver");
......@@ -327,7 +319,6 @@ void LoadCategoriesJobTest::shouldReadRules_data()
tmp.enabled = true;
qtKdeCategories.append(tmp);
QTest::newRow("oneelementdebug") << QStringLiteral("oneelementdebug.ini") << QStringLiteral("correct.categories") << false
<< LoggingCategory::List()
<< qtKdeCategories;
......@@ -381,13 +372,13 @@ void LoadCategoriesJobTest::shouldReadRules()
QCOMPARE(job.customCategories().count(), customcategories.count());
#ifdef DEBUG_RESULT
Q_FOREACH(const LoggingCategory &cat, job.customCategories()) {
qDebug() << "customcategories cat." << cat.description << " logname" << cat.logName << " enabled " << cat.enabled << "type "<<cat.loggingType;
Q_FOREACH (const LoggingCategory &cat, job.customCategories()) {
qDebug() << "customcategories cat." << cat.description << " logname" << cat.logName << " enabled " << cat.enabled << "type " << cat.loggingType;
}
qDebug() << "AFTER";
Q_FOREACH(const LoggingCategory &cat, customcategories) {
qDebug() << "customcategories cat." << cat.description << " logname" << cat.logName << " enabled " << cat.enabled << "type "<<cat.loggingType;
Q_FOREACH (const LoggingCategory &cat, customcategories) {
qDebug() << "customcategories cat." << cat.description << " logname" << cat.logName << " enabled " << cat.enabled << "type " << cat.loggingType;
}
#endif
......@@ -398,17 +389,16 @@ void LoadCategoriesJobTest::shouldReadRules()
QCOMPARE(job.qtKdeCategories().count(), qtkdecategories.count());
#ifdef DEBUG_RESULT
Q_FOREACH(const LoggingCategory &cat, job.qtKdeCategories()) {
qDebug() << "qtKdeCategories cat." << cat.description << " logname" << cat.logName << " enabled " << cat.enabled << "type "<<cat.loggingType;
Q_FOREACH (const LoggingCategory &cat, job.qtKdeCategories()) {
qDebug() << "qtKdeCategories cat." << cat.description << " logname" << cat.logName << " enabled " << cat.enabled << "type " << cat.loggingType;
}
qDebug() << "AFTER";
Q_FOREACH(const LoggingCategory &cat, qtkdecategories) {
qDebug() << "qtKdeCategories cat." << cat.description << " logname" << cat.logName << " enabled " << cat.enabled << "type "<<cat.loggingType;
Q_FOREACH (const LoggingCategory &cat, qtkdecategories) {
qDebug() << "qtKdeCategories cat." << cat.description << " logname" << cat.logName << " enabled " << cat.enabled << "type " << cat.loggingType;
}
#endif
QCOMPARE(job.qtKdeCategories(), qtkdecategories);
}
QTEST_MAIN(LoadCategoriesJobTest)
......@@ -36,5 +36,4 @@ private Q_SLOTS:
void shouldReadRules();
};
#endif // LOADCATEGORIESJOBTEST_H
......@@ -76,7 +76,7 @@ void ConfigureCustomSettingWidget::setRule(const QString &rule)
const KDebugSettingsUtil::LoadLoggingCategory cat = KDebugSettingsUtil::parseLineLoggingQtCategory(rule);
mCategoryLineEdit->setText(cat.logName);
mEnableCategory->setChecked(cat.enabled);
switch(cat.type) {
switch (cat.type) {
case KDebugSettingsUtil::LoadLoggingCategory::Unknown:
break;
case KDebugSettingsUtil::LoadLoggingCategory::Info:
......
......@@ -86,7 +86,7 @@ void CustomDebugSettingsPage::fillList(const LoggingCategory::List &list)
Q_FOREACH (const LoggingCategory &cat, list) {
QString ruleStr;
ruleStr = cat.logName;
switch(cat.loggingType) {
switch (cat.loggingType) {
case LoggingCategory::All:
break;
case LoggingCategory::Info:
......@@ -123,7 +123,7 @@ LoggingCategory::List CustomDebugSettingsPage::rules()
LoggingCategory tmp;
tmp.enabled = cat.enabled;
tmp.logName = cat.logName;
switch(cat.type) {
switch (cat.type) {
case KDebugSettingsUtil::LoadLoggingCategory::Unknown:
break;
case KDebugSettingsUtil::LoadLoggingCategory::Info:
......
......@@ -223,7 +223,7 @@ void KDebugSettingsDialog::slotInsertCategories()
if (!path.isEmpty()) {
const KdeLoggingCategory::List insertCategoriesList = KDebugSettingsUtil::readLoggingCategoriesForInserting(path, mCategories);
LoggingCategory::List newCategories;
Q_FOREACH(const KdeLoggingCategory &cat, insertCategoriesList) {
Q_FOREACH (const KdeLoggingCategory &cat, insertCategoriesList) {
LoggingCategory loggingCat;
loggingCat.description = cat.description;
loggingCat.logName = cat.logName;
......
......@@ -188,8 +188,8 @@ LoggingCategory::List KDebugSettingsUtil::readLoggingQtCategories(const QString
if (rulesSections) {
KDebugSettingsUtil::LoadLoggingCategory cat = parseLineLoggingQtCategory(line);
qDebug()<<" line "<< line;
qDebug()<<"enable "<<cat.enabled << " valid : "<< cat.isValid();
qDebug() << " line " << line;
qDebug() << "enable " << cat.enabled << " valid : " << cat.isValid();
if (cat.isValid()) {
if (cat.enabled) {
KDebugSettingsUtil::LoadLoggingCategory nextCat = hashLoadLoggingCategories.value(cat.logName);
......@@ -208,12 +208,12 @@ LoggingCategory::List KDebugSettingsUtil::readLoggingQtCategories(const QString
} else {
KDebugSettingsUtil::LoadLoggingCategory nextCat = hashLoadLoggingCategories.value(cat.logName);
if (!nextCat.isValid()) {
cat.enabled =false;
cat.enabled = false;
hashLoadLoggingCategories.insert(cat.logName, cat);
} else {
if (!nextCat.enabled) {
nextCat.type |= cat.type;
nextCat.enabled =false;
nextCat.enabled = false;
hashLoadLoggingCategories[cat.logName] = nextCat;
}
}
......@@ -235,7 +235,7 @@ LoggingCategory::List KDebugSettingsUtil::readLoggingQtCategories(const QString
} else {
cat.loggingType = LoggingCategory::Off;
}
qDebug() << "SSSSSSSSSSSSSSSSSS cat.enable"<<cat.enabled;
qDebug() << "SSSSSSSSSSSSSSSSSS cat.enable" << cat.enabled;
} else if ((value.type & LoadLoggingCategory::Debug) &&
(value.type & LoadLoggingCategory::Info) &&
(value.type & LoadLoggingCategory::Warning) &&
......@@ -261,7 +261,7 @@ LoggingCategory::List KDebugSettingsUtil::readLoggingQtCategories(const QString
} else if (value.type & LoadLoggingCategory::Off) {
cat.loggingType = LoggingCategory::Off;
} else if (value.type & LoadLoggingCategory::Unknown) {
qDebug()<<" OFF "<< cat.logName;
qDebug() << " OFF " << cat.logName;
cat.loggingType = LoggingCategory::Off;
}
//qDebug()<<"cat.loggingType"<<cat.loggingType;
......
......@@ -56,9 +56,9 @@ struct LoadLoggingCategory {
bool operator ==(const LoadLoggingCategory &other) const
{
qDebug()<< " enabled "<< enabled << " other.enabled :"<<other.enabled;
qDebug()<< " logname "<< logName << " other.logName :"<<other.logName;
qDebug()<<" type"<<type << " other.type "<< other.type;
qDebug() << " enabled " << enabled << " other.enabled :" << other.enabled;
qDebug() << " logname " << logName << " other.logName :" << other.logName;
qDebug() << " type" << type << " other.type " << other.type;
return (enabled == other.enabled) &&
(type == other.type) &&
(logName == other.logName);
......
......@@ -24,7 +24,6 @@
#include "kdeloggingcategory.h"
#include "loggingcategory.h"
class LoadCategoriesJob
{
public:
......
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