Changeset View
Changeset View
Standalone View
Standalone View
src/backends/fake/kauth-policy-gen-polkit.cpp
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | |||||
42 | { | 42 | { | ||
43 | Q_UNUSED(domain) | 43 | Q_UNUSED(domain) | ||
44 | 44 | | |||
45 | QTextStream out(stdout); | 45 | QTextStream out(stdout); | ||
46 | out.setCodec("UTF-8"); | 46 | out.setCodec("UTF-8"); | ||
47 | 47 | | |||
48 | out << header; | 48 | out << header; | ||
49 | 49 | | |||
50 | foreach (const Action &action, actions) { | 50 | for (const Action &action : qAsConst(actions)) { | ||
51 | out << dent << "<action id=\"" << action.name << "\" >\n"; | 51 | out << dent << "<action id=\"" << action.name << "\" >\n"; | ||
52 | 52 | | |||
53 | foreach (const QString &lang, action.descriptions.keys()) { | 53 | const auto lstKeys = action.descriptions.keys(); | ||
54 | for (const QString &lang : lstKeys) { | ||||
54 | out << dent << dent << "<description"; | 55 | out << dent << dent << "<description"; | ||
55 | if (lang != "en") { | 56 | if (lang != "en") { | ||
56 | out << " xml:lang=\"" << lang << '"'; | 57 | out << " xml:lang=\"" << lang << '"'; | ||
57 | } | 58 | } | ||
58 | out << '>' << action.messages.value(lang) << "</description>\n"; | 59 | out << '>' << action.messages.value(lang) << "</description>\n"; | ||
59 | } | 60 | } | ||
60 | 61 | | |||
61 | foreach (const QString &lang, action.messages.keys()) { | 62 | const auto lstMessagesKeys = action.messages.keys(); | ||
63 | for (const QString &lang : lstMessagesKeys) { | ||||
62 | out << dent << dent << "<message"; | 64 | out << dent << dent << "<message"; | ||
63 | if (lang != "en") { | 65 | if (lang != "en") { | ||
64 | out << " xml:lang=\"" << lang << '"'; | 66 | out << " xml:lang=\"" << lang << '"'; | ||
65 | } | 67 | } | ||
66 | out << '>' << action.descriptions.value(lang) << "</message>\n"; | 68 | out << '>' << action.descriptions.value(lang) << "</message>\n"; | ||
67 | } | 69 | } | ||
68 | 70 | | |||
69 | QString policy = action.policy; | 71 | QString policy = action.policy; | ||
Show All 11 Lines |