summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMarius Storm-Olsen <marius@trolltech.com>2009-05-29 09:21:16 +0200
committerMarius Storm-Olsen <marius@trolltech.com>2009-05-29 11:00:03 +0200
commite08f3e7bf3dbae6036ab89248793b98330971269 (patch)
treeeced1da2b7be6014508240686af8f04424a506fd /tools
parent7bc17b5b9ff9f2e3e04f36fec8ccbb546d9b7a31 (diff)
Only display the choice of license if we can find the files
Task-number: 254451 Reviewed-by: eskil BT: yes
Diffstat (limited to 'tools')
-rw-r--r--tools/configure/configureapp.cpp43
1 files changed, 23 insertions, 20 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index a6b06a679f..b9d172f7c1 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -3483,12 +3483,15 @@ void Configure::readLicense()
dictionary[ "PLATFORM NAME" ] = (QFile::exists(dictionary["QT_SOURCE_TREE"] + "/src/corelib/kernel/qfunctions_wince.h")
&& (dictionary.value("QMAKESPEC").startsWith("wince") || dictionary.value("XQMAKESPEC").startsWith("wince")))
? "Qt for Windows CE" : "Qt for Windows";
+ dictionary["LICENSE FILE"] = sourcePath;
+
bool openSource = false;
+ bool hasOpenSource = QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.GPL3") || QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.LGPL");
if (dictionary["BUILDNOKIA"] == "yes" || dictionary["BUILDTYPE"] == "commercial") {
openSource = false;
} else if (dictionary["BUILDTYPE"] == "opensource") {
openSource = true;
- } else {
+ } else if (hasOpenSource) { // No Open Source? Just display the commercial license right away
forever {
char accept = '?';
cout << "Which edition of Qt do you want to use ?" << endl;
@@ -3506,28 +3509,23 @@ void Configure::readLicense()
}
}
}
- if (openSource) {
- dictionary["LICENSE FILE"] = sourcePath;
- if (QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.GPL3") || QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.LGPL")) {
- cout << endl << "This is the " << dictionary["PLATFORM NAME"] << " Open Source Edition." << endl;
- licenseInfo["LICENSEE"] = "Open Source";
- dictionary["EDITION"] = "OpenSource";
- dictionary["QT_EDITION"] = "QT_EDITION_OPENSOURCE";
- cout << endl;
- if (!showLicense(dictionary["LICENSE FILE"])) {
- cout << "Configuration aborted since license was not accepted";
- dictionary["DONE"] = "error";
- return;
- }
+ if (hasOpenSource && openSource) {
+ cout << endl << "This is the " << dictionary["PLATFORM NAME"] << " Open Source Edition." << endl;
+ licenseInfo["LICENSEE"] = "Open Source";
+ dictionary["EDITION"] = "OpenSource";
+ dictionary["QT_EDITION"] = "QT_EDITION_OPENSOURCE";
+ cout << endl;
+ if (!showLicense(dictionary["LICENSE FILE"])) {
+ cout << "Configuration aborted since license was not accepted";
+ dictionary["DONE"] = "error";
return;
}
-#ifndef COMMERCIAL_VERSION
- else {
- cout << endl << "Cannot find the GPL license files!" << endl;
+ } 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
- } else {
+#ifdef COMMERCIAL_VERSION
+ else {
Tools::checkLicense(dictionary, licenseInfo, firstLicensePath());
if (dictionary["DONE"] != "error" && dictionary["BUILDNOKIA"] != "yes") {
// give the user some feedback, and prompt for license acceptance
@@ -3539,7 +3537,12 @@ void Configure::readLicense()
}
}
}
-#endif // COMMERCIAL_VERSION
+#else // !COMMERCIAL_VERSION
+ else {
+ cout << endl << "Cannot build commercial edition from the open source version of the library." << endl;
+ dictionary["DONE"] = "error";
+ }
+#endif
}
void Configure::reloadCmdLine()