From 2cdafb099945bd534f0c752edf8d4f1ab80ed45f Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 23 Oct 2015 16:32:59 +0200 Subject: Convert some QDateTime::currentDateTime() to currentDateTimeUtc() (I) The latter is much faster as it doesn't have to deal with time zones. This change handles the trivial ones: Either the call to currentDateTime() is immediately followed by a call to toUTC() or toTime_t(). The latter is much faster on UTC QDateTimes, too. Credits to Milian Wolff, from whose QtWS15 talk this advice is taken. Change-Id: I872f5bbb26cbecedc1e5c0dbee4d5ac2c6eb67ee Reviewed-by: Milian Wolff --- src/gui/painting/qpdf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index 47483b2869..d746ab9379 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -1498,7 +1498,7 @@ void QPdfEnginePrivate::writeInfo() printString(creator); xprintf("\n/Producer "); printString(QString::fromLatin1("Qt " QT_VERSION_STR)); - QDateTime now = QDateTime::currentDateTime().toUTC(); + QDateTime now = QDateTime::currentDateTimeUtc(); QTime t = now.time(); QDate d = now.date(); xprintf("\n/CreationDate (D:%d%02d%02d%02d%02d%02d)\n", -- cgit v1.2.3