mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
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:
committed by
Mathew Sutcliffe
parent
6a06aa0460
commit
9ff322ae25
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "threadedreader.h"
|
||||
#include "blackmisc/threadutils.h"
|
||||
#include "blackmisc/network/networkutils.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Network;
|
||||
@@ -26,15 +27,7 @@ namespace BlackMisc
|
||||
|
||||
qint64 CThreadedReader::lastModifiedMsSinceEpoch(QNetworkReply *nwReply) const
|
||||
{
|
||||
if (nwReply)
|
||||
{
|
||||
QVariant lastModifiedQv = nwReply->header(QNetworkRequest::LastModifiedHeader);
|
||||
if (lastModifiedQv.isValid() && lastModifiedQv.canConvert<QDateTime>())
|
||||
{
|
||||
return lastModifiedQv.value<QDateTime>().toMSecsSinceEpoch();
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
return CNetworkUtils::lastModifiedMsSinceEpoch(nwReply);
|
||||
}
|
||||
|
||||
QDateTime CThreadedReader::getUpdateTimestamp() const
|
||||
|
||||
Reference in New Issue
Block a user