qt: Don't use QDateTime::toSecsSinceEpoch

* lang/qt/src/qgpgmequickjob.cpp (addSubkeyWorker)
(createWorker): Use toMSecsSinceEpoch instead toSecsSinceEpoch.

--
toSecsSinceEpoch was only introduced in Qt 5.8.
This commit is contained in:
Andre Heinecke 2017-12-11 17:07:10 +01:00
parent 0a567a94d9
commit b61d0fbb74
No known key found for this signature in database
GPG Key ID: 2978E9D40CBABA5C

View File

@ -59,7 +59,7 @@ static QGpgMEQuickJob::result_type createWorker(GpgME::Context *ctx,
auto err = ctx->createKey(uid.toUtf8().constData(), auto err = ctx->createKey(uid.toUtf8().constData(),
algo, algo,
0, 0,
expires.isValid() ? (unsigned long) expires.toSecsSinceEpoch() : 0, expires.isValid() ? (unsigned long) (expires.toMSecsSinceEpoch() / 1000) : 0,
key, key,
flags); flags);
return std::make_tuple(err, QString(), Error()); return std::make_tuple(err, QString(), Error());
@ -72,7 +72,7 @@ static QGpgMEQuickJob::result_type addSubkeyWorker(GpgME::Context *ctx,
unsigned int flags) unsigned int flags)
{ {
auto err = ctx->createSubkey(key, algo, 0, auto err = ctx->createSubkey(key, algo, 0,
expires.isValid() ? (unsigned long) expires.toSecsSinceEpoch() : 0, expires.isValid() ? (unsigned long) (expires.toMSecsSinceEpoch() / 1000): 0,
flags); flags);
return std::make_tuple(err, QString(), Error()); return std::make_tuple(err, QString(), Error());
} }