Ref T42, util function to create network report

This commit is contained in:
Klaus Basan
2017-04-28 02:24:29 +02:00
committed by Mathew Sutcliffe
parent 297ef8ea16
commit d46257f670
2 changed files with 67 additions and 2 deletions

View File

@@ -12,10 +12,12 @@
#ifndef BLACKMISC_NETWORKUTILS_H
#define BLACKMISC_NETWORKUTILS_H
#include "blackmisc/blackmiscexport.h"
#include "blackmisc/network/urllist.h"
#include "blackmisc/blackmiscexport.h"
#include "blackmisc/statusmessagelist.h"
#include <QNetworkRequest>
#include <QNetworkAccessManager>
#include <QString>
#include <QStringList>
#include <QtGlobal>
@@ -46,6 +48,9 @@ namespace BlackMisc
//! Default for timeout
static int getTimeoutMs();
//! Default for timeout (long)
static int getLongTimeoutMs();
//! Can ping the address?
//! \note uses OS ping
static bool canPing(const QString &hostAddress);
@@ -137,6 +142,13 @@ namespace BlackMisc
//! Remove the HTML formatting from a PHP error message
static QString removeHtmlPartsFromPhpErrorMessage(const QString &errorMessage);
//! Status about network
static BlackMisc::CStatusMessageList createNetworkReport(const QNetworkAccessManager *am);
//! Status about network, can be used when an URL fails to resolve issues
//! \remark that can take a moment to complete, as it checks network
static BlackMisc::CStatusMessageList createNetworkReport(const CUrl &url, const QNetworkAccessManager *am = nullptr);
private:
//! Hidden constructor
CNetworkUtils() {}