summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-11-18 18:59:44 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-11-18 18:59:44 (GMT)
commit732e0d01df867200546ddb5e6f8695f263e1ee0d (patch)
tree80db5be1c8b9e740c8f8509c8bc2df878356163b /src/corelib
parent9fe840c54e373c26fd54bb04eadb25e14ad4040b (diff)
downloadQt-732e0d01df867200546ddb5e6f8695f263e1ee0d.zip
Qt-732e0d01df867200546ddb5e6f8695f263e1ee0d.tar.gz
Qt-732e0d01df867200546ddb5e6f8695f263e1ee0d.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
Diffstat (limited to 'src/corelib')
-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 fe47a30..d5eb8c2 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;