feat: fix auto switch

This commit is contained in:
NickVs2015
2026-01-30 14:36:29 +03:00
parent 65ba95f344
commit 586e1f0b71
2 changed files with 13 additions and 2 deletions
-2
View File
@@ -46,8 +46,6 @@ public:
QQmlApplicationEngine *qmlEngine() const;
QNetworkAccessManager *networkManager();
QClipboard *getClipboard();
CoreController *coreController() const { return m_coreController.data(); }
public slots:
void forceQuit();
@@ -225,6 +225,19 @@ void CoreController::initControllers()
m_connectionController, this);
setQmlContextProperty("SubscriptionUiController", m_subscriptionUiController);
connect(m_connectionUiController, &ConnectionUiController::requestSetCurrentProtocol,
this, [this](const QString &protocol) {
const QString serverId = m_serversController->getDefaultServerId();
if (!serverId.isEmpty()) {
m_subscriptionUiController->setCurrentProtocol(serverId, protocol);
}
}, Qt::QueuedConnection);
connect(m_connectionUiController, &ConnectionUiController::requestUpdateServiceFromGateway,
m_subscriptionUiController, &SubscriptionUiController::updateServiceFromGateway, Qt::QueuedConnection);
connect(m_subscriptionUiController, &SubscriptionUiController::updateServiceFromGatewayCompleted,
m_connectionUiController, &ConnectionUiController::onUpdateServiceFromGatewayCompleted,
Qt::QueuedConnection);
m_apiNewsUiController = new ApiNewsUiController(m_newsModel, m_newsController, this);
setQmlContextProperty("ApiNewsController", m_apiNewsUiController);