MCPcopy Create free account
hub / github.com/Martchus/syncthingtray / handleStateChanged

Method handleStateChanged

syncthingwidgets/quick/app.cpp:504–528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

502}
503
504void 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
530void App::handleConnectionStatusChanged(Data::SyncthingStatus newStatus)
531{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected