[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdev-clang-tidy] src: Use QString() over ""/QString("")/QStringLiteral("") (isNull() not used)
From:       Friedrich W. H. Kossebau <null () kde ! org>
Date:       2018-07-31 20:15:15
Message-ID: E1fkb35-0007N1-HA () code ! kde ! org
[Download RAW message or body]

Git commit 880ad765f67e868dc69837e3ed98656601b491d8 by Friedrich W. H. Kossebau.
Committed on 31/07/2018 at 15:13.
Pushed by kossebau into branch 'master'.

Use QString() over ""/QString("")/QStringLiteral("") (isNull() not used)

M  +1    -1    src/config/configgroup.h
M  +5    -5    src/config/perprojectconfigpage.cpp
M  +1    -1    src/parsers/replacementparser.cpp
M  +1    -1    src/plugin.cpp

https://commits.kde.org/kdev-clang-tidy/880ad765f67e868dc69837e3ed98656601b491d8

diff --git a/src/config/configgroup.h b/src/config/configgroup.h
index c045bd3..3758918 100644
--- a/src/config/configgroup.h
+++ b/src/config/configgroup.h
@@ -94,7 +94,7 @@ public:
 
     void enableEntry(const Option& key, bool enable)
     {
-        enable ? writeEntry(key, QStringLiteral("")) : deleteEntry(key);
+        enable ? writeEntry(key, QString()) : deleteEntry(key);
     }
 };
 }
diff --git a/src/config/perprojectconfigpage.cpp b/src/config/perprojectconfigpage.cpp
index 9b1766f..164978b 100644
--- a/src/config/perprojectconfigpage.cpp
+++ b/src/config/perprojectconfigpage.cpp
@@ -127,13 +127,13 @@ void PerProjectConfigPage::defaults()
     // Right now it only works with manual entry.
     m_config.writeEntry(ConfigGroup::ExecutablePath, "/usr/bin/clang-tidy");
 
-    m_config.writeEntry(ConfigGroup::HeaderFilter, "");
-    ui->headerFilterText->setText("");
+    m_config.writeEntry(ConfigGroup::HeaderFilter, QString());
+    ui->headerFilterText->setText(QString());
 
-    m_config.writeEntry(ConfigGroup::AdditionalParameters, "");
-    ui->clangtidyParameters->setText(QString(""));
+    m_config.writeEntry(ConfigGroup::AdditionalParameters, QString());
+    ui->clangtidyParameters->setText(QString());
 
-    m_config.writeEntry(ConfigGroup::CheckSystemHeaders, "");
+    m_config.writeEntry(ConfigGroup::CheckSystemHeaders, QString());
     ui->sysHeadersCheckBox->setChecked(false);
 
     m_config.enableEntry(ConfigGroup::UseConfigFile, false);
diff --git a/src/parsers/replacementparser.cpp b/src/parsers/replacementparser.cpp
index ca444f3..e878c3a 100644
--- a/src/parsers/replacementparser.cpp
+++ b/src/parsers/replacementparser.cpp
@@ -144,7 +144,7 @@ Replacement ReplacementParser::nextNode(const QRegularExpressionMatch& smatch)
     } else {
         repl.offset = 0;
         repl.length = 0;
-        repl.replacementText = QStringLiteral("");
+        repl.replacementText.clear();
     }
 
     return repl;
diff --git a/src/plugin.cpp b/src/plugin.cpp
index 4a44d42..2eca0cb 100644
--- a/src/plugin.cpp
+++ b/src/plugin.cpp
@@ -100,7 +100,7 @@ Plugin::Plugin(QObject* parent, const QVariantList& /*unused*/)
 
     collectAllAvailableChecks(clangTidyPath);
 
-    m_config.writeEntry(ConfigGroup::AdditionalParameters, "");
+    m_config.writeEntry(ConfigGroup::AdditionalParameters, QString());
     for (auto check : m_allChecks) {
         bool enable = check.contains("cert") || check.contains("-core.") || check.contains("-cplusplus")
             || check.contains("-deadcode") || check.contains("-security") || check.contains("cppcoreguide");

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic