diff options
author | Stéphane Lepin <stephane.lepin@gmail.com> | 2017-08-26 11:03:34 +0200 |
---|---|---|
committer | Stéphane Lepin <stephane.lepin@gmail.com> | 2017-08-26 11:03:34 +0200 |
commit | d984089f396df6d34eb86017fc9ead008f24dc48 (patch) | |
tree | 5f627ff222b7283eb4d74810dfc7a052d8b6e4ae /src/broadcast | |
parent | b0aefaadb93b539696efd0de4edb89ea7cd45277 (diff) |
Broadcasting status: show failure status if all enabled conns fail
Diffstat (limited to 'src/broadcast')
-rw-r--r-- | src/broadcast/broadcastmanager.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/broadcast/broadcastmanager.cpp b/src/broadcast/broadcastmanager.cpp index 7bf2088bc3..c1041d6743 100644 --- a/src/broadcast/broadcastmanager.cpp +++ b/src/broadcast/broadcastmanager.cpp @@ -178,13 +178,17 @@ ShoutConnectionPtr BroadcastManager::findConnectionForProfile(BroadcastProfilePt void BroadcastManager::slotConnectionStatusChanged(int newState) { Q_UNUSED(newState); - int totalConn = 0, connectingCount = 0, + int enabledCount = 0, connectingCount = 0, connectedCount = 0, failedCount = 0; // Collect status info QList<BroadcastProfilePtr> profiles = m_pBroadcastSettings->profiles(); - totalConn = profiles.size(); for (BroadcastProfilePtr profile : profiles) { + if(!profile->getEnabled()) { + continue; + } + enabledCount++; + int status = profile->connectionStatus(); if (status == BroadcastProfile::STATUS_FAILURE) { failedCount++; @@ -195,14 +199,13 @@ void BroadcastManager::slotConnectionStatusChanged(int newState) { else if (status == BroadcastProfile::STATUS_CONNECTED) { connectedCount++; } - } // Changed global status indicator depending on global connections status - if (failedCount >= totalConn) { + if (failedCount >= enabledCount) { m_pStatusCO->forceSet(STATUSCO_FAILURE); } - else if (failedCount > 0 && failedCount < totalConn) { + else if (failedCount > 0 && failedCount < enabledCount) { m_pStatusCO->forceSet(STATUSCO_WARNING); } else if (connectingCount > 0) { |