Go to the documentation of this file.
28 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
29 "<!DOCTYPE policyconfig PUBLIC\n"
30 "\"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN\"\n"
31 "\"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd\">\n"
36 " <allow_inactive>%1</allow_inactive>\n"
37 " <allow_active>%2</allow_active>\n"
44 QTextStream out(stdout);
45 out.setCodec(
"UTF-8");
51 blacklist.insert(QChar::fromLatin1(
'&'), QString::fromLatin1(
"&"));
53 if (domain.contains(QLatin1String(
"vendor"))) {
55 QString vendor = domain[QLatin1String(
"vendor")];
56 for (blI = blacklist.constBegin(); blI != blacklist.constEnd(); ++blI) {
57 vendor.replace(blI.key(), blI.value());
59 out <<
"<vendor>" << vendor <<
"</vendor>\n";
61 if (domain.contains(QLatin1String(
"vendorurl"))) {
62 out <<
"<vendor_url>" << domain[QLatin1String(
"vendorurl")] <<
"</vendor_url>\n";
64 if (domain.contains(QLatin1String(
"icon"))) {
65 out <<
"<icon_name>" << domain[QLatin1String(
"icon")] <<
"</icon_name>\n";
68 foreach (
const Action &action, actions) {
69 out <<
dent <<
"<action id=\"" << action.
name <<
"\" >\n";
72 out <<
dent <<
dent <<
"<description";
73 if (i.key() != QLatin1String(
"en")) {
74 out <<
" xml:lang=\"" << i.key() <<
'"';
78 QString description = i.value();
79 for (blI = blacklist.constBegin(); blI != blacklist.constEnd(); ++blI) {
80 description.replace(blI.key(), blI.value());
83 out <<
'>' << description <<
"</description>\n";
90 if (i.key() != QLatin1String(
"en")) {
91 out <<
" xml:lang=\"" << i.key() <<
'"';
96 for (blI = blacklist.constBegin(); blI != blacklist.constEnd(); ++blI) {
97 message.replace(blI.key(), blI.value());
100 out <<
'>' << message <<
"</message>\n";
105 if (!action.
persistence.isEmpty() && policy != QLatin1String(
"yes") && policy != QLatin1String(
"no")) {
106 policy += QLatin1String(
"_keep_") + action.
persistence;
108 if (!action.
persistence.isEmpty() && policyInactive != QLatin1String(
"yes") &&
109 policyInactive != QLatin1String(
"no")) {
110 policyInactive += QLatin1String(
"_keep_") + action.
persistence;
115 out <<
dent <<
"</action>\n";
118 out <<
"</policyconfig>\n";
void output(QList< Action > actions, QHash< QString, QString > domain)
QHash< QString, QString > messages
QHash< QString, QString > descriptions
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.