summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-11-18 18:59:44 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-11-19 12:43:50 (GMT)
commitb32f1f637b8844afad51a49512f6ef7ffaf1b33e (patch)
tree5fff1c5b6aea5b4ff4529b3a9fbf866c5f5c8559 /src
parent6365b2ae3a01e00085e49deffed1068950b2a07f (diff)
downloadQt-b32f1f637b8844afad51a49512f6ef7ffaf1b33e.zip
Qt-b32f1f637b8844afad51a49512f6ef7ffaf1b33e.tar.gz
Qt-b32f1f637b8844afad51a49512f6ef7ffaf1b33e.tar.bz2
Fix the evaluation nag in binary installs with commercial licenses.
It wasn't generating any message, but it did think it was an evaluation install. So all Qt console applications produced an extra newline and the GUI ones showed the Qt logo briefly. I noticed because of the extra newline when building Qt itself. Reviewed-by: Trust Me (cherry picked from commit 732e0d01df867200546ddb5e6f8695f263e1ee0d)
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qtcore_eval.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/corelib/kernel/qtcore_eval.cpp b/src/corelib/kernel/qtcore_eval.cpp
index 0f01c12..d32a5c1 100644
--- a/src/corelib/kernel/qtcore_eval.cpp
+++ b/src/corelib/kernel/qtcore_eval.cpp
@@ -88,23 +88,12 @@ static const char will_shutdown_now[] =
"timeout and will shut down.\n"
"Contact http://qt.nokia.com/about/contact-us for pricing and purchasing information.\n";
-static int qt_eval_days_left()
+static int qt_eval_is_supported()
{
const char *const license_key = qt_eval_key_data + 12;
// fast fail
if (!qt_eval_key_data[0] || !*license_key)
- return -2;
-
- QDate today = QDate::currentDate();
- QDate build = QLibraryInfo::buildDate();
- return qMax(-1, today.daysTo(build) + 30);
-}
-
-static int qt_eval_is_supported()
-{
- const char *const license_key = qt_eval_key_data + 12;
- if (!qt_eval_key_data[0] || !*license_key)
return -1;
// is this an unsupported evaluation?
@@ -123,6 +112,16 @@ static int qt_eval_is_supported()
return -1;
}
+static int qt_eval_days_left()
+{
+ if (qt_eval_is_supported() < 0)
+ return -2;
+
+ QDate today = QDate::currentDate();
+ QDate build = QLibraryInfo::buildDate();
+ return qMax(-1, today.daysTo(build) + 30);
+}
+
static QString qt_eval_string()
{
const char *msg;
@@ -178,6 +177,9 @@ public:
void qt_core_eval_init(uint type)
{
+ if (!type)
+ return; // GUI app
+
switch (qt_eval_days_left()) {
case -2:
return;