aboutsummaryrefslogtreecommitdiff
path: root/src/core/kauthorized.cpp
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2015-10-05 15:16:16 +0200
committerAlbert Astals Cid <aacid@kde.org>2015-10-05 15:16:16 +0200
commit788e2a5509d3072dde1c5243186e70e9dfedf5cc (patch)
treedafc0f730f4eac85a766f2ba653812c5fb377a03 /src/core/kauthorized.cpp
parent4ade818d2046f2c91df480386d04674619c1f5ed (diff)
downloadkconfig-788e2a5509d3072dde1c5243186e70e9dfedf5cc.tar.gz
kconfig-788e2a5509d3072dde1c5243186e70e9dfedf5cc.tar.bz2
Minor optimizations
Ran the clazy tool (http://www.kdab.com/use-static-analysis-improve-performance/) Mostly QStringLiteral/QLatin1String additions A few const & additions to non public methods Compiles, test pass REVIEW: 125106
Diffstat (limited to 'src/core/kauthorized.cpp')
-rw-r--r--src/core/kauthorized.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/core/kauthorized.cpp b/src/core/kauthorized.cpp
index 4280524d..4de7218c 100644
--- a/src/core/kauthorized.cpp
+++ b/src/core/kauthorized.cpp
@@ -54,7 +54,7 @@ public:
{ b = true; s = s.mid(1); } \
else b = false;
#define checkEqual(s, b) \
- b = (s == QString::fromLatin1("="));
+ b = (s == QLatin1String("="));
URLActionRule(const QByteArray &act,
const QString &bProt, const QString &bHost, const QString &bPath,
@@ -267,39 +267,39 @@ static void initUrlActionRestrictions()
// d->urlActionRestrictions.append(
// URLActionRule("list", Any, Any, Any, "file", Any, QDir::homePath(), true));
d->urlActionRestrictions.append(
- URLActionRule("link", Any, Any, Any, QLatin1String(":internet"), Any, Any, true));
+ URLActionRule("link", Any, Any, Any, QStringLiteral(":internet"), Any, Any, true));
d->urlActionRestrictions.append(
- URLActionRule("redirect", Any, Any, Any, QLatin1String(":internet"), Any, Any, true));
+ URLActionRule("redirect", Any, Any, Any, QStringLiteral(":internet"), Any, Any, true));
// We allow redirections to file: but not from internet protocols, redirecting to file:
// is very popular among io-slaves and we don't want to break them
d->urlActionRestrictions.append(
- URLActionRule("redirect", Any, Any, Any, QLatin1String("file"), Any, Any, true));
+ URLActionRule("redirect", Any, Any, Any, QStringLiteral("file"), Any, Any, true));
d->urlActionRestrictions.append(
- URLActionRule("redirect", QLatin1String(":internet"), Any, Any, QLatin1String("file"), Any, Any, false));
+ URLActionRule("redirect", QStringLiteral(":internet"), Any, Any, QStringLiteral("file"), Any, Any, false));
// local protocols may redirect everywhere
d->urlActionRestrictions.append(
- URLActionRule("redirect", QLatin1String(":local"), Any, Any, Any, Any, Any, true));
+ URLActionRule("redirect", QStringLiteral(":local"), Any, Any, Any, Any, Any, true));
// Anyone may redirect to about:
d->urlActionRestrictions.append(
- URLActionRule("redirect", Any, Any, Any, QLatin1String("about"), Any, Any, true));
+ URLActionRule("redirect", Any, Any, Any, QStringLiteral("about"), Any, Any, true));
// Anyone may redirect to mailto:
d->urlActionRestrictions.append(
- URLActionRule("redirect", Any, Any, Any, QLatin1String("mailto"), Any, Any, true));
+ URLActionRule("redirect", Any, Any, Any, QStringLiteral("mailto"), Any, Any, true));
// Anyone may redirect to itself, cq. within it's own group
d->urlActionRestrictions.append(
- URLActionRule("redirect", Any, Any, Any, QLatin1String("="), Any, Any, true));
+ URLActionRule("redirect", Any, Any, Any, QStringLiteral("="), Any, Any, true));
d->urlActionRestrictions.append(
- URLActionRule("redirect", QLatin1String("about"), Any, Any, Any, Any, Any, true));
+ URLActionRule("redirect", QStringLiteral("about"), Any, Any, Any, Any, Any, true));
KConfigGroup cg(KSharedConfig::openConfig(), "KDE URL Restrictions");
int count = cg.readEntry("rule_count", 0);
- QString keyFormat = QString::fromLatin1("rule_%1");
+ QString keyFormat = QStringLiteral("rule_%1");
for (int i = 1; i <= count; i++) {
QString key = keyFormat.arg(i);
const QStringList rule = cg.readEntry(key, QStringList());