| 159 | } |
| 160 | |
| 161 | void VersionChecker::updateSubscriptions() |
| 162 | { |
| 163 | switch(currentState) { |
| 164 | case NOT_INIT: |
| 165 | qWarning(CAT_VERSION) << "VersionChecker is not initialized."; |
| 166 | break; |
| 167 | case IN_PROGRESS: |
| 168 | qDebug(CAT_VERSION) << "VersionChecker is in progress"; |
| 169 | break; |
| 170 | case DONE: |
| 171 | for(auto &function : qAsConst(m_subscriptions)) { |
| 172 | std::invoke(function, m_cache); |
| 173 | } |
| 174 | |
| 175 | // the functions that were called should not be called again, in case a new class subscribes |
| 176 | m_subscriptions.clear(); |
| 177 | break; |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | #include "moc_versionchecker.cpp" |