KAuth
7 #include <auth/policy-gen/policy-gen.h>
10 #include <QTextStream>
15 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
16 "<!DOCTYPE policyconfig PUBLIC\n"
17 "\"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN\"\n"
18 "\"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd\">\n"
21 const char policy_tag[] =
24 " <allow_inactive>no</allow_inactive>\n"
25 " <allow_active>%1</allow_active>\n"
28 const char dent[] =
" ";
36 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
37 out.setCodec(
"UTF-8");
42 for (
const Action &action : std::as_const(actions)) {
43 out << dent <<
"<action id=\"" << action.name <<
"\" >\n";
45 const auto lstKeys = action.descriptions.keys();
46 for (
const QString &lang : lstKeys) {
47 out << dent << dent <<
"<description";
49 out <<
" xml:lang=\"" << lang <<
'"';
51 out << '>
' << action.messages.value(lang) << "</description>\n";
54 const auto lstMessagesKeys = action.messages.keys();
55 for (const QString &lang : lstMessagesKeys) {
56 out << dent << dent << "<message";
58 out << " xml:lang=\"" << lang << '"';
60 out << '>' << action.descriptions.value(lang) << "</
message>\n
";
63 QString policy = action.policy;
64 if (!action.persistence.isEmpty()) {
65 policy += "_keep_
" + action.persistence;
68 out << QString(policy_tag).arg(policy);
70 out << dent << "</action>\n
";
73 out << "</policyconfig>\n
";
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 6 2023 04:14:27 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.