Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kkoehne committed Nov 22, 2016
1 parent e1f0e08 commit a9af3c8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
34 changes: 20 additions & 14 deletions tools/configure/configureapp.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}

Expand Down
8 changes: 1 addition & 7 deletions tools/configure/tools.cpp
Expand Up @@ -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 =
Expand All @@ -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
Expand Down

0 comments on commit a9af3c8

Please sign in to comment.