Changeset View
Changeset View
Standalone View
Standalone View
src/kauthaction.cpp
Show All 18 Lines | |||||
19 | 19 | | |||
20 | #include "kauthaction.h" | 20 | #include "kauthaction.h" | ||
21 | 21 | | |||
22 | #include <QtGlobal> | 22 | #include <QtGlobal> | ||
23 | #include <QRegExp> | 23 | #include <QRegExp> | ||
24 | 24 | | |||
25 | class QWidget; | 25 | class QWidget; | ||
26 | 26 | | |||
27 | #include "kauthdebug.h" | ||||
27 | #include "kauthexecutejob.h" | 28 | #include "kauthexecutejob.h" | ||
28 | 29 | | |||
29 | #include "BackendsManager.h" | 30 | #include "BackendsManager.h" | ||
30 | 31 | | |||
31 | namespace KAuth | 32 | namespace KAuth | ||
32 | { | 33 | { | ||
33 | 34 | | |||
34 | class ActionData : public QSharedData | 35 | class ActionData : public QSharedData | ||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Line(s) | |||||
116 | void Action::setName(const QString &name) | 117 | void Action::setName(const QString &name) | ||
117 | { | 118 | { | ||
118 | d->name = name; | 119 | d->name = name; | ||
119 | 120 | | |||
120 | // Does the backend support checking for known actions? | 121 | // Does the backend support checking for known actions? | ||
121 | if (BackendsManager::authBackend()->capabilities() & KAuth::AuthBackend::CheckActionExistenceCapability) { | 122 | if (BackendsManager::authBackend()->capabilities() & KAuth::AuthBackend::CheckActionExistenceCapability) { | ||
122 | // In this case, just ask the backend | 123 | // In this case, just ask the backend | ||
123 | d->valid = BackendsManager::authBackend()->actionExists(name); | 124 | d->valid = BackendsManager::authBackend()->actionExists(name); | ||
125 | if (!d->valid) | ||||
126 | qCWarning(KAUTH) << "Backend does not recognize action: " << name; | ||||
meven: Code style, use {} even for one liner. | |||||
124 | } else { | 127 | } else { | ||
125 | // Otherwise, check through a regexp | 128 | // Otherwise, check through a regexp | ||
126 | QRegExp exp(QLatin1String("[0-z]+(\\.[0-z]+)*")); | 129 | QRegExp exp(QLatin1String("[0-z]+(\\.[0-z]+)*")); | ||
127 | d->valid = exp.exactMatch(name); | 130 | d->valid = exp.exactMatch(name); | ||
131 | if (!d->valid) | ||||
132 | qCWarning(KAUTH) << "Action has an invalid name: " << name; | ||||
128 | } | 133 | } | ||
129 | } | 134 | } | ||
130 | 135 | | |||
131 | // Accessors | 136 | // Accessors | ||
132 | int Action::timeout() const | 137 | int Action::timeout() const | ||
133 | { | 138 | { | ||
134 | return d->timeout; | 139 | return d->timeout; | ||
135 | } | 140 | } | ||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |
Code style, use {} even for one liner.