| 297 | } |
| 298 | |
| 299 | void Component::setVersion(const QString& version) |
| 300 | { |
| 301 | if (version == m_version) { |
| 302 | return; |
| 303 | } |
| 304 | m_version = version; |
| 305 | if (m_loaded) { |
| 306 | // we are loaded and potentially have state to invalidate |
| 307 | if (m_file) { |
| 308 | // we have a file... explicit version has been changed and there is nothing else to do. |
| 309 | } else { |
| 310 | // we don't have a file, therefore we are loaded with metadata |
| 311 | m_cachedVersion = version; |
| 312 | // see if the meta version is loaded |
| 313 | auto metaVersion = APPLICATION->metadataIndex()->get(m_uid, version); |
| 314 | if (metaVersion->isLoaded()) { |
| 315 | // if yes, we can continue with that. |
| 316 | m_metaVersion = metaVersion; |
| 317 | } else { |
| 318 | // if not, we need loading |
| 319 | m_metaVersion.reset(); |
| 320 | m_loaded = false; |
| 321 | } |
| 322 | updateCachedData(); |
| 323 | } |
| 324 | } else { |
| 325 | // not loaded... assume it will be sorted out later by the update task |
| 326 | } |
| 327 | emit dataChanged(); |
| 328 | } |
| 329 | |
| 330 | bool Component::customize() |
| 331 | { |
no test coverage detected