MCPcopy Create free account
hub / github.com/KDE/kdevelop / encode

Function encode

kdevplatform/util/environmentprofilelist.cpp:59–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59void encode(KConfig* config, const EnvironmentProfileListPrivate* d)
60{
61 KConfigGroup cfg(config, Strings::envGroup());
62 cfg.writeEntry(Strings::defaultEnvProfileKey(), d->m_defaultProfileName);
63 cfg.writeEntry(Strings::profileListKey(), d->m_profiles.keys());
64 const auto oldGroupList = cfg.groupList();
65 for (const QString& group : oldGroupList) {
66 if (!d->m_profiles.contains(group)) {
67 cfg.deleteGroup(group);
68 }
69 }
70
71 for (auto it = d->m_profiles.cbegin(), itEnd = d->m_profiles.cend(); it != itEnd; ++it) {
72 KConfigGroup envgrp(&cfg, it.key());
73 envgrp.deleteGroup();
74
75 const auto val = it.value();
76 for (auto it2 = val.cbegin(), it2End = val.cend(); it2 != it2End; ++it2) {
77 envgrp.writeEntry(it2.key(), *it2);
78 }
79 }
80
81 cfg.sync();
82}
83
84}
85

Callers 1

saveSettingsMethod · 0.85

Calls 8

envGroupFunction · 0.85
defaultEnvProfileKeyFunction · 0.85
profileListKeyFunction · 0.85
writeEntryMethod · 0.80
keysMethod · 0.45
containsMethod · 0.45
keyMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected