qt: Don't use QDateTime::toSecsSinceEpoch
authorAndre Heinecke <aheinecke@intevation.de>
Mon, 11 Dec 2017 16:07:10 +0000 (17:07 +0100)
committerAndre Heinecke <aheinecke@intevation.de>
Mon, 11 Dec 2017 16:08:38 +0000 (17:08 +0100)
* lang/qt/src/qgpgmequickjob.cpp (addSubkeyWorker)
(createWorker): Use toMSecsSinceEpoch instead toSecsSinceEpoch.

--
toSecsSinceEpoch was only introduced in Qt 5.8.

lang/qt/src/qgpgmequickjob.cpp

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