| 195 | } |
| 196 | |
| 197 | void BoxedwineData::loadContainers() { |
| 198 | for (auto &container : BoxedwineData::containers) { |
| 199 | delete container; |
| 200 | } |
| 201 | BoxedwineData::containers.clear(); |
| 202 | Fs::iterateAllNativeFiles(GlobalSettings::getContainerFolder(), false, true, [] (BString filepath, bool isDir)->U32 { |
| 203 | if (isDir) { |
| 204 | BoxedContainer* container = new BoxedContainer(); |
| 205 | if (container->load(filepath)) { |
| 206 | BoxedwineData::containers.push_back(container); |
| 207 | } else { |
| 208 | delete container; |
| 209 | } |
| 210 | } |
| 211 | return 0; |
| 212 | }); |
| 213 | BoxedwineData::sortContainers(); |
| 214 | } |
| 215 | |
| 216 | void BoxedwineData::loadUI() { |
| 217 | loadContainers(); |