| 116 | } |
| 117 | |
| 118 | void BoxedContainer::loadApps() { |
| 119 | BString appDirPath = GlobalSettings::getAppFolder(this); |
| 120 | |
| 121 | this->apps.clear(); |
| 122 | |
| 123 | Fs::iterateAllNativeFiles(appDirPath, true, false, [this] (BString filepath, bool isDir)->U32 { |
| 124 | if (filepath.endsWith(".ini", true)) { |
| 125 | BoxedApp* app = new BoxedApp(); |
| 126 | if (app->load(this, filepath)) { |
| 127 | this->apps.push_back(app); |
| 128 | } else { |
| 129 | delete app; |
| 130 | } |
| 131 | } |
| 132 | return 0; |
| 133 | }); |
| 134 | } |
| 135 | |
| 136 | void BoxedContainer::deleteApp(BoxedApp* app) { |
| 137 | std::vector<BoxedApp*>::iterator position = std::find(this->apps.begin(), this->apps.end(), app); |