| 39 | } |
| 40 | |
| 41 | void decode(KConfig* config, EnvironmentProfileListPrivate* d) |
| 42 | { |
| 43 | KConfigGroup cfg(config, Strings::envGroup()); |
| 44 | d->m_defaultProfileName = cfg.readEntry(Strings::defaultEnvProfileKey(), Strings::defaultProfileName()); |
| 45 | const QStringList profileNames = |
| 46 | cfg.readEntry(Strings::profileListKey(), QStringList{Strings::defaultProfileName()}); |
| 47 | for (const auto& profileName : profileNames) { |
| 48 | KConfigGroup envgrp(&cfg, profileName); |
| 49 | QMap<QString, QString> variables; |
| 50 | const auto varNames = envgrp.keyList(); |
| 51 | for (const QString& varname : varNames) { |
| 52 | variables[varname] = envgrp.readEntry(varname, QString()); |
| 53 | } |
| 54 | |
| 55 | d->m_profiles.insert(profileName, variables); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | void encode(KConfig* config, const EnvironmentProfileListPrivate* d) |
| 60 | { |
no test coverage detected