win: Show Tech Preview license

Show the tech preview license for commercial users if -confirm-license
is not set. This matches what the configure shell script is doing, too.

Task-number: QTBUG-55676
Change-Id: I69f5553ab53dfcdc14c200e682c024a6cebee8fe
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
bb10
Kai Koehne 2016-09-16 11:27:00 +02:00
parent e1f0e08e9a
commit a9af3c8502
2 changed files with 21 additions and 21 deletions

View File

@ -4550,11 +4550,6 @@ Configure::ProjectType Configure::projectType(const QString& proFileName)
bool Configure::showLicense(QString orgLicenseFile)
{
if (dictionary["LICENSE_CONFIRMED"] == "yes") {
cout << "You have already accepted the terms of the license." << endl << endl;
return true;
}
bool showLgpl2 = true;
QString licenseFile = orgLicenseFile;
QString theLicense;
@ -4665,21 +4660,32 @@ void Configure::readLicense()
}
}
if (hasOpenSource && openSource) {
cout << endl << "This is the " << dictionary["PLATFORM NAME"] << " Open Source Edition." << endl;
cout << endl << "This is the " << dictionary["PLATFORM NAME"] << " Open Source Edition." << endl << endl;
dictionary["LICENSEE"] = "Open Source";
dictionary["EDITION"] = "OpenSource";
cout << endl;
if (!showLicense(dictionary["LICENSE FILE"])) {
cout << "Configuration aborted since license was not accepted";
dictionary["DONE"] = "error";
return;
}
} else if (openSource) {
cout << endl << "Cannot find the GPL license files! Please download the Open Source version of the library." << endl;
dictionary["DONE"] = "error";
} else {
QString tpLicense = sourcePath + "/LICENSE.PREVIEW.COMMERCIAL";
if (QFile::exists(tpLicense)) {
cout << endl << "This is the Qt Preview Edition." << endl << endl;
dictionary["EDITION"] = "Preview";
dictionary["LICENSE FILE"] = tpLicense;
} else {
Tools::checkLicense(dictionary, sourcePath, buildPath);
}
}
else {
Tools::checkLicense(dictionary, sourcePath, buildPath);
if (dictionary["LICENSE_CONFIRMED"] != "yes") {
if (!showLicense(dictionary["LICENSE FILE"])) {
cout << "Configuration aborted since license was not accepted" << endl;
dictionary["DONE"] = "error";
return;
}
} else if (dictionary["LICHECK"].isEmpty()) { // licheck executable shows license
cout << "You have already accepted the terms of the license." << endl << endl;
}
}

View File

@ -47,13 +47,6 @@ using namespace std;
void Tools::checkLicense(QMap<QString,QString> &dictionary,
const QString &sourcePath, const QString &buildPath)
{
QString tpLicense = sourcePath + "/LICENSE.PREVIEW.COMMERCIAL";
if (QFile::exists(tpLicense)) {
dictionary["EDITION"] = "Preview";
dictionary["LICENSE FILE"] = tpLicense;
return;
}
dictionary["LICHECK"] = "licheck.exe";
const QString licenseChecker =
@ -80,6 +73,7 @@ void Tools::checkLicense(QMap<QString,QString> &dictionary,
} else {
foreach (const QString &var, licheckOutput.split('\n'))
dictionary[var.section('=', 0, 0).toUpper()] = var.section('=', 1, 1);
dictionary["LICENSE_CONFIRMED"] = "yes";
}
} else {
cout << endl << "Error: Could not find licheck.exe" << endl