From 3cae7dcc5af53bacbf2e181092895c7b27439bca Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 16 May 2014 16:53:14 +0200 Subject: Use expiry_date field to check for evaluation timespan Use the new dedicated field instead of just assuming that the evaluation timespan is buildtime + 30 days. Change-Id: Ibf4078f030ea609d823fe01889a106a5da345817 Reviewed-by: Janne Anttila Reviewed-by: Iikka Eklund --- src/corelib/kernel/qtcore_eval.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qtcore_eval.cpp b/src/corelib/kernel/qtcore_eval.cpp index a5c4c36638..c938e0fb5b 100644 --- a/src/corelib/kernel/qtcore_eval.cpp +++ b/src/corelib/kernel/qtcore_eval.cpp @@ -119,9 +119,11 @@ static EvaluationStatus qt_eval_is_supported() static int qt_eval_days_left() { + const char *expiry_date = const_cast(qt_eval_expiry_date + 12); + QDate today = QDate::currentDate(); - QDate build = QLibraryInfo::buildDate(); - return qMax(-1, today.daysTo(build) + 30); + QDate lastday = QDate::fromString(QString::fromLatin1(expiry_date), Qt::ISODate); + return today.daysTo(lastday); } static bool qt_eval_is_expired() -- cgit v1.2.3