mirror of
https://github.com/QuasarApp/qca.git
synced 2025-04-26 19:44:32 +00:00
Use QDateTime::to/fromSecsSinceEpoch()
QDateTime::to/fromTime_t() are deprecated since Qt 5.8.
This commit is contained in:
parent
e6a15466ae
commit
effbe387a0
@ -35,9 +35,7 @@ static QDateTime getTimestamp(const QString &s)
|
|||||||
if (s.contains(QLatin1Char('T'))) {
|
if (s.contains(QLatin1Char('T'))) {
|
||||||
return QDateTime::fromString(s, Qt::ISODate);
|
return QDateTime::fromString(s, Qt::ISODate);
|
||||||
} else {
|
} else {
|
||||||
QDateTime dt;
|
return QDateTime::fromSecsSinceEpoch(s.toInt());
|
||||||
dt.setTime_t(s.toInt());
|
|
||||||
return dt;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3432,8 +3432,8 @@ public:
|
|||||||
BN_free(bn);
|
BN_free(bn);
|
||||||
|
|
||||||
// validity period
|
// validity period
|
||||||
ASN1_TIME_set(X509_get_notBefore(x), opts.notValidBefore().toTime_t());
|
ASN1_TIME_set(X509_get_notBefore(x), opts.notValidBefore().toSecsSinceEpoch());
|
||||||
ASN1_TIME_set(X509_get_notAfter(x), opts.notValidAfter().toTime_t());
|
ASN1_TIME_set(X509_get_notAfter(x), opts.notValidAfter().toSecsSinceEpoch());
|
||||||
|
|
||||||
// public key
|
// public key
|
||||||
X509_set_pubkey(x, pk);
|
X509_set_pubkey(x, pk);
|
||||||
@ -3836,8 +3836,8 @@ public:
|
|||||||
BN_free(bn);
|
BN_free(bn);
|
||||||
|
|
||||||
// validity period
|
// validity period
|
||||||
ASN1_TIME_set(X509_get_notBefore(x), QDateTime::currentDateTimeUtc().toTime_t());
|
ASN1_TIME_set(X509_get_notBefore(x), QDateTime::currentDateTimeUtc().toSecsSinceEpoch());
|
||||||
ASN1_TIME_set(X509_get_notAfter(x), notValidAfter.toTime_t());
|
ASN1_TIME_set(X509_get_notAfter(x), notValidAfter.toSecsSinceEpoch());
|
||||||
|
|
||||||
X509_set_pubkey(x, static_cast<const MyPKeyContext *>(req.subjectPublicKey())->get_pkey());
|
X509_set_pubkey(x, static_cast<const MyPKeyContext *>(req.subjectPublicKey())->get_pkey());
|
||||||
X509_set_subject_name(x, subjectName);
|
X509_set_subject_name(x, subjectName);
|
||||||
|
@ -1048,7 +1048,7 @@ private:
|
|||||||
|
|
||||||
Certificate cert = Certificate::fromDER(QByteArray((char *)blob, blob_size));
|
Certificate cert = Certificate::fromDER(QByteArray((char *)blob, blob_size));
|
||||||
|
|
||||||
*expiration = cert.notValidAfter().toTime_t();
|
*expiration = cert.notValidAfter().toSecsSinceEpoch();
|
||||||
|
|
||||||
return TRUE; // krazy:exclude=captruefalse
|
return TRUE; // krazy:exclude=captruefalse
|
||||||
}
|
}
|
||||||
|
@ -1250,7 +1250,7 @@ public:
|
|||||||
{
|
{
|
||||||
const QDateTime now = QDateTime::currentDateTime();
|
const QDateTime now = QDateTime::currentDateTime();
|
||||||
|
|
||||||
uint t = now.toTime_t();
|
uint t = now.toSecsSinceEpoch();
|
||||||
if (now.time().msec() > 0)
|
if (now.time().msec() > 0)
|
||||||
t /= now.time().msec();
|
t /= now.time().msec();
|
||||||
qsrand(t);
|
qsrand(t);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user