mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 23:45:35 +08:00
Utility function to directly log warning when network not accessible
This commit is contained in:
committed by
Mathew Sutcliffe
parent
8aed8f598e
commit
76b3b6c0b6
@@ -11,6 +11,7 @@
|
||||
#include "blackcore/application.h"
|
||||
#include "blackmisc/network/networkutils.h"
|
||||
#include "blackmisc/threadutils.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QMetaObject>
|
||||
@@ -66,9 +67,14 @@ namespace BlackCore
|
||||
return delta <= timeLastMs;
|
||||
}
|
||||
|
||||
bool CThreadedReader::isNetworkAccessible() const
|
||||
bool CThreadedReader::isNetworkAccessible(const QString &logWarningMessage) const
|
||||
{
|
||||
return sApp->isNetworkAccessible();
|
||||
const bool a = sApp->isNetworkAccessible();
|
||||
if (!a && !logWarningMessage.isEmpty())
|
||||
{
|
||||
CLogMessage(this).warning(logWarningMessage);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
void CThreadedReader::startReader()
|
||||
|
||||
Reference in New Issue
Block a user