| 50 | } |
| 51 | |
| 52 | WelcomeScreenHelper::~WelcomeScreenHelper() { |
| 53 | // save width&height ratio values |
| 54 | KConfigGroup conf(KSharedConfig::openConfig(), "WelcomeScreenHelper"); |
| 55 | |
| 56 | int widthCount = m_widthScale.size(); |
| 57 | conf.writeEntry("width_count", widthCount); |
| 58 | int currentWidthIndex = 0; |
| 59 | |
| 60 | for (auto item = m_widthScale.begin(); item != m_widthScale.end() && currentWidthIndex < widthCount; ++item) { |
| 61 | conf.writeEntry("widthName_" + QString::number(currentWidthIndex), item.key()); |
| 62 | conf.writeEntry("widthValue_" + QString::number(currentWidthIndex), QString::number(item.value())); |
| 63 | currentWidthIndex++; |
| 64 | } |
| 65 | |
| 66 | int heightCount = m_heightScale.size(); |
| 67 | conf.writeEntry("height_count", widthCount); |
| 68 | int currentHeightIndex = 0; |
| 69 | |
| 70 | for (auto item = m_heightScale.begin(); item != m_heightScale.end() && currentHeightIndex < heightCount; ++item) { |
| 71 | conf.writeEntry("heightName_" + QString::number(currentHeightIndex), item.key()); |
| 72 | conf.writeEntry("heightValue_" + QString::number(currentHeightIndex), QString::number(item.value())); |
| 73 | currentHeightIndex++; |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * @brief Loads the saved configuration |