This method is always called from the main thread
| 139 | |
| 140 | // This method is always called from the main thread |
| 141 | void NewFieldRegistered(const StatusBarField& identifier) |
| 142 | { |
| 143 | mCallEnqueued = true; |
| 144 | mNewFields.push_back(identifier); |
| 145 | |
| 146 | AppEvents::OnAppInitialized( |
| 147 | [this] |
| 148 | { |
| 149 | if (mCallEnqueued) |
| 150 | { |
| 151 | BasicUI::CallAfter( |
| 152 | [this] |
| 153 | { |
| 154 | for (auto& project : AllProjects {}) |
| 155 | { |
| 156 | for (const auto& field : mNewFields) |
| 157 | Dispatch(*project, field); |
| 158 | } |
| 159 | |
| 160 | mNewFields.clear(); |
| 161 | mCallEnqueued = false; |
| 162 | }); |
| 163 | } |
| 164 | }); |
| 165 | } |
| 166 | |
| 167 | private: |
| 168 | std::vector<StatusBarField> mNewFields; |
no test coverage detected