| 41 | } |
| 42 | |
| 43 | void WorkingSetController::initialize() |
| 44 | { |
| 45 | //Load all working-sets |
| 46 | KConfigGroup setConfig(Core::self()->activeSession()->config(), QStringLiteral("Working File Sets")); |
| 47 | QMap<QString, QStringList> areaConfigs; |
| 48 | const auto sets = setConfig.groupList(); |
| 49 | for (const QString& set : sets) { |
| 50 | // do not load working set if the id contains an '|', because it then belongs to an area. |
| 51 | // this is functionally equivalent to the if ( ! config->icon ) stuff which was there before. |
| 52 | if (set.contains(QLatin1Char('|'))) { |
| 53 | areaConfigs[set.left(set.indexOf(QLatin1Char('|')))] << set; |
| 54 | } else if (!setConfig.group(set).hasKey("Orientation") && setConfig.group(set).readEntry("View Count", 0) == 0) { |
| 55 | areaConfigs[set] << set; |
| 56 | } else { |
| 57 | workingSet(set); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | // Clean up config |
| 62 | for (auto it = areaConfigs.constBegin(); it != areaConfigs.constEnd(); ++it) { |
| 63 | if (m_workingSets.contains(it.key())) { |
| 64 | continue; |
| 65 | } |
| 66 | for (auto &areaConfig : it.value()) { |
| 67 | setConfig.deleteGroup(areaConfig); |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | m_emptyWorkingSet = new WorkingSet(QStringLiteral("empty")); |
| 72 | |
| 73 | if(!(Core::self()->setupFlags() & Core::NoUi)) { |
| 74 | setupActions(); |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | void WorkingSetController::cleanup() |
| 79 | { |
nothing calls this directly
no test coverage detected