refs #597, use CMD arguments in setup reader.

* Setup reader will now be initialized and handles by CApplication
* Setup reader no longer threaded reader as it will be initialized and loade upfront
This commit is contained in:
Klaus Basan
2016-02-18 19:56:35 +01:00
committed by Mathew Sutcliffe
parent 6a06aa0460
commit 9ff322ae25
8 changed files with 281 additions and 136 deletions

View File

@@ -246,5 +246,18 @@ namespace BlackMisc
CNetworkUtils::ignoreSslVerification(request);
return request;
}
qint64 CNetworkUtils::lastModifiedMsSinceEpoch(QNetworkReply *nwReply)
{
if (nwReply)
{
QVariant lastModifiedQv = nwReply->header(QNetworkRequest::LastModifiedHeader);
if (lastModifiedQv.isValid() && lastModifiedQv.canConvert<QDateTime>())
{
return lastModifiedQv.value<QDateTime>().toMSecsSinceEpoch();
}
}
return -1;
}
} // namespace
} // namespacee

View File

@@ -20,6 +20,7 @@
#include <QStringList>
#include <QUrlQuery>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QJsonObject>
namespace BlackMisc
@@ -110,10 +111,12 @@ namespace BlackMisc
//! Our tweakes network request
static QNetworkRequest getNetworkRequest(const CUrl &url, RequestType type = Get);
//! Last modified from reply
static qint64 lastModifiedMsSinceEpoch(QNetworkReply *nwReply);
private:
//! Hidden constructor
CNetworkUtils() {}
};
} // namespace
} // namespace