summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2016-06-22 13:59:02 +0200
committerMontel Laurent <[email protected]>2016-06-22 13:59:02 +0200
commit08bb5adea62657e625cc216c03aa6cac781f5b4e (patch)
tree5526c747a61e7d3ee4468364b5f68c270c929702
parent8540c2a51e7202ee48f92f7256293841b59138e7 (diff)
Astyle kdelibs
-rw-r--r--autotests/kdebugsettingutiltest.cpp2
-rw-r--r--autotests/loadcategoriesjobtest.cpp82
-rw-r--r--autotests/loadcategoriesjobtest.h1
-rw-r--r--src/configurecustomsettingwidget.cpp2
-rw-r--r--src/customdebugsettingspage.cpp6
-rw-r--r--src/kdebugsettingsdialog.cpp2
-rw-r--r--src/kdebugsettingsutil.cpp12
-rw-r--r--src/kdebugsettingsutil.h6
-rw-r--r--src/loadcategoriesjob.h1
9 files changed, 51 insertions, 63 deletions
diff --git a/autotests/kdebugsettingutiltest.cpp b/autotests/kdebugsettingutiltest.cpp
index 39e15a5..74c112d 100644
--- a/autotests/kdebugsettingutiltest.cpp
+++ b/autotests/kdebugsettingutiltest.cpp
@@ -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()
diff --git a/autotests/loadcategoriesjobtest.cpp b/autotests/loadcategoriesjobtest.cpp
index 1979d3a..29d4bb3 100644
--- a/autotests/loadcategoriesjobtest.cpp
+++ b/autotests/loadcategoriesjobtest.cpp
@@ -91,9 +91,8 @@ void LoadCategoriesJobTest::shouldReadRules_data()
qtKdeCategories.append(tmp);
QTest::newRow("emptywithlistkdeloggingcategories") << QStringLiteral("rulebeforerulessectionfiles.ini") << QStringLiteral("correct.categories") << false
- << LoggingCategory::List()
- << qtKdeCategories;
-
+ << LoggingCategory::List()
+ << qtKdeCategories;
qtKdeCategories.clear();
tmp.description = QStringLiteral("KPasswdServer (KIO)");
@@ -126,15 +125,13 @@ void LoadCategoriesJobTest::shouldReadRules_data()
tmp.enabled = true;
qtKdeCategories.append(tmp);
-
QTest::newRow("oneelementoff") << QStringLiteral("oneelementoff.ini") << QStringLiteral("correct.categories") << false
- << LoggingCategory::List()
- << qtKdeCategories;
+ << LoggingCategory::List()
+ << qtKdeCategories;
QTest::newRow("oneelementonelineoff") << QStringLiteral("oneelementonelineoff.ini") << QStringLiteral("correct.categories") << false
- << LoggingCategory::List()
- << qtKdeCategories;
-
+ << LoggingCategory::List()
+ << qtKdeCategories;
qtKdeCategories.clear();
tmp.description = QStringLiteral("KPasswdServer (KIO)");
@@ -167,14 +164,13 @@ void LoadCategoriesJobTest::shouldReadRules_data()
tmp.enabled = true;
qtKdeCategories.append(tmp);
-
QTest::newRow("oneelementall") << QStringLiteral("oneelementall.ini") << QStringLiteral("correct.categories") << false
- << LoggingCategory::List()
- << qtKdeCategories;
+ << LoggingCategory::List()
+ << qtKdeCategories;
QTest::newRow("oneelementonelineall") << QStringLiteral("oneelementonelineall.ini") << QStringLiteral("correct.categories") << false
- << LoggingCategory::List()
- << qtKdeCategories;
+ << LoggingCategory::List()
+ << qtKdeCategories;
qtKdeCategories.clear();
tmp.description = QStringLiteral("KPasswdServer (KIO)");
@@ -207,14 +203,13 @@ void LoadCategoriesJobTest::shouldReadRules_data()
tmp.enabled = true;
qtKdeCategories.append(tmp);
-
QTest::newRow("oneelementinfo") << QStringLiteral("oneelementinfo.ini") << QStringLiteral("correct.categories") << false
- << LoggingCategory::List()
- << qtKdeCategories;
+ << LoggingCategory::List()
+ << qtKdeCategories;
QTest::newRow("oneelementinfo") << QStringLiteral("oneelementinfobis.ini") << QStringLiteral("correct.categories") << false
- << LoggingCategory::List()
- << qtKdeCategories;
+ << LoggingCategory::List()
+ << qtKdeCategories;
qtKdeCategories.clear();
tmp.description = QStringLiteral("KPasswdServer (KIO)");
@@ -247,10 +242,9 @@ void LoadCategoriesJobTest::shouldReadRules_data()
tmp.enabled = true;
qtKdeCategories.append(tmp);
-
QTest::newRow("oneelementwarning") << QStringLiteral("oneelementwarning.ini") << QStringLiteral("correct.categories") << false
- << LoggingCategory::List()
- << qtKdeCategories;
+ << LoggingCategory::List()
+ << qtKdeCategories;
qtKdeCategories.clear();
tmp.description = QStringLiteral("KPasswdServer (KIO)");
@@ -283,18 +277,16 @@ void LoadCategoriesJobTest::shouldReadRules_data()
tmp.enabled = true;
qtKdeCategories.append(tmp);
-
QTest::newRow("oneelementcritical") << QStringLiteral("oneelementcritical.ini") << QStringLiteral("correct.categories") << false
- << LoggingCategory::List()
- << qtKdeCategories;
+ << LoggingCategory::List()
+ << qtKdeCategories;
QTest::newRow("oneelementonelinecritical") << QStringLiteral("oneelementonelinecritical.ini") << QStringLiteral("correct.categories") << false
- << LoggingCategory::List()
- << qtKdeCategories;
+ << LoggingCategory::List()
+ << qtKdeCategories;
QTest::newRow("oneelementtwolinecritical") << QStringLiteral("oneelementonelinecritical.ini") << QStringLiteral("correct.categories") << false
- << LoggingCategory::List()
- << qtKdeCategories;
-
+ << LoggingCategory::List()
+ << qtKdeCategories;
qtKdeCategories.clear();
tmp.description = QStringLiteral("KPasswdServer (KIO)");
@@ -327,10 +319,9 @@ void LoadCategoriesJobTest::shouldReadRules_data()
tmp.enabled = true;
qtKdeCategories.append(tmp);
-
QTest::newRow("oneelementdebug") << QStringLiteral("oneelementdebug.ini") << QStringLiteral("correct.categories") << false
- << LoggingCategory::List()
- << qtKdeCategories;
+ << LoggingCategory::List()
+ << qtKdeCategories;
// Test with extract elements
LoggingCategory::List customCategories;
@@ -341,8 +332,8 @@ void LoadCategoriesJobTest::shouldReadRules_data()
customCategories.append(customTmp);
QTest::newRow("oneelementdebugandanextract") << QStringLiteral("oneelementdebugandanextract.ini") << QStringLiteral("correct.categories") << false
- << customCategories
- << qtKdeCategories;
+ << customCategories
+ << qtKdeCategories;
// Test with extract elements
customCategories.clear();
@@ -352,8 +343,8 @@ void LoadCategoriesJobTest::shouldReadRules_data()
customCategories.append(customTmp);
QTest::newRow("oneelementdebugandanextract") << QStringLiteral("oneelementdebugandanextractfalse.ini") << QStringLiteral("correct.categories") << false
- << customCategories
- << qtKdeCategories;
+ << customCategories
+ << 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)
diff --git a/autotests/loadcategoriesjobtest.h b/autotests/loadcategoriesjobtest.h
index f9e56cf..a03f63a 100644
--- a/autotests/loadcategoriesjobtest.h
+++ b/autotests/loadcategoriesjobtest.h
@@ -36,5 +36,4 @@ private Q_SLOTS:
void shouldReadRules();
};
-
#endif // LOADCATEGORIESJOBTEST_H
diff --git a/src/configurecustomsettingwidget.cpp b/src/configurecustomsettingwidget.cpp
index 0562f03..8cfae9c 100644
--- a/src/configurecustomsettingwidget.cpp
+++ b/src/configurecustomsettingwidget.cpp
@@ -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:
diff --git a/src/customdebugsettingspage.cpp b/src/customdebugsettingspage.cpp
index fbc5a3a..c1631f7 100644
--- a/src/customdebugsettingspage.cpp
+++ b/src/customdebugsettingspage.cpp
@@ -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,9 +123,9 @@ 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;
+ break;
case KDebugSettingsUtil::LoadLoggingCategory::Info:
tmp.loggingType = LoggingCategory::Info;
break;
diff --git a/src/kdebugsettingsdialog.cpp b/src/kdebugsettingsdialog.cpp
index 2b3d930..42da12e 100644
--- a/src/kdebugsettingsdialog.cpp
+++ b/src/kdebugsettingsdialog.cpp
@@ -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;
diff --git a/src/kdebugsettingsutil.cpp b/src/kdebugsettingsutil.cpp
index 5bede1f..ff44732 100644
--- a/src/kdebugsettingsutil.cpp
+++ b/src/kdebugsettingsutil.cpp
@@ -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;
diff --git a/src/kdebugsettingsutil.h b/src/kdebugsettingsutil.h
index f481de2..e519862 100644
--- a/src/kdebugsettingsutil.h
+++ b/src/kdebugsettingsutil.h
@@ -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);
diff --git a/src/loadcategoriesjob.h b/src/loadcategoriesjob.h
index fe2198d..4280a77 100644
--- a/src/loadcategoriesjob.h
+++ b/src/loadcategoriesjob.h
@@ -24,7 +24,6 @@
#include "kdeloggingcategory.h"
#include "loggingcategory.h"
-
class LoadCategoriesJob
{
public: