| 502 | } |
| 503 | |
| 504 | void App::handleStateChanged(Qt::ApplicationState state) |
| 505 | { |
| 506 | if (m_isGuiLoaded && ((state == Qt::ApplicationSuspended) || (state & Qt::ApplicationHidden))) { |
| 507 | qDebug() << "App considered suspended/hidden, reducing polling, stopping UI processing"; |
| 508 | setCurrentControls(false); |
| 509 | for (auto *const uiObject : m_uiObjects) { |
| 510 | uiObject->moveToThread(nullptr); |
| 511 | } |
| 512 | if (m_unloadGuiWhenHidden) { |
| 513 | m_unloadGuiWhenHidden = false; |
| 514 | unloadMain(); |
| 515 | } |
| 516 | } else if (state & Qt::ApplicationActive) { |
| 517 | qDebug() << "App considered active, continuing polling, resuming UI processing"; |
| 518 | setCurrentControls(true); |
| 519 | auto *const uiThread = thread(); |
| 520 | for (auto *const uiObject : m_uiObjects) { |
| 521 | uiObject->moveToThread(uiThread); |
| 522 | } |
| 523 | if (!m_isGuiLoaded) { |
| 524 | QtUtilities::deletePipelineCacheIfNeeded(); |
| 525 | m_appEngine ? loadMain() : initEngine(); |
| 526 | } |
| 527 | } |
| 528 | } |
| 529 | |
| 530 | void App::handleConnectionStatusChanged(Data::SyncthingStatus newStatus) |
| 531 | { |
nothing calls this directly
no outgoing calls
no test coverage detected