Do not trigger loads if they are doomed to fail

This commit is contained in:
Klaus Basan
2017-09-27 03:01:03 +02:00
parent f2820ba5a5
commit 15e46ba94a
6 changed files with 37 additions and 3 deletions

View File

@@ -45,16 +45,22 @@ namespace BlackCore
QTimer::singleShot(0, &m_updateTimer, [this] { this->m_updateTimer.start(); }); // restart
}
bool CNetworkWatchdog::hasWorkingSharedUrl() const
{
if (!m_networkAccessible) { return false; }
return !this->getWorkingSharedUrl().isEmpty();
}
CUrl CNetworkWatchdog::getWorkingSharedUrl() const
{
if (!m_networkAccessible) return CUrl();
if (!m_networkAccessible) { return CUrl(); }
QReadLocker l(&m_lockSharedUrl);
return m_workingSharedUrl;
}
int CNetworkWatchdog::triggerCheck()
{
if (!this->doWorkCheck()) return false; // senseless
if (!this->doWorkCheck()) { return false; } // senseless
if (m_checkInProgress) { return -1; }
const int n = this->getCheckCount();