diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2022-06-09 12:33:48 +0200 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2022-06-09 14:27:29 +0000 |
commit | ab635dd4b220b88c96dd240ddc03670b7ddf8175 (patch) | |
tree | 00ad75826439223a49c1a3a4d4799c44e7801ab7 | |
parent | a5d501d22e78948c2bf300b5e6bf01ecd44352a0 (diff) | |
download | qt-creator-ab635dd4b220b88c96dd240ddc03670b7ddf8175.tar.gz |
QmlDesigner: Do license check only once
We should only make the license check once.
An evaluationLicense is handled as enterprise license.
Change-Id: Ib4b53795a7d735c10b5238f1e7b76346a9bcc8e1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
-rw-r--r-- | src/plugins/qmldesigner/dynamiclicensecheck.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/plugins/qmldesigner/dynamiclicensecheck.h b/src/plugins/qmldesigner/dynamiclicensecheck.h index fb1e3661b8..8ddcf55a15 100644 --- a/src/plugins/qmldesigner/dynamiclicensecheck.h +++ b/src/plugins/qmldesigner/dynamiclicensecheck.h @@ -37,6 +37,7 @@ namespace QmlDesigner { enum FoundLicense { + noLicense, community, professional, enterprise @@ -58,12 +59,28 @@ ExtensionSystem::IPlugin *licenseCheckerPlugin() FoundLicense checkLicense() { + static FoundLicense license = noLicense; + + if (license != noLicense) + return license; + if (auto plugin = Internal::licenseCheckerPlugin()) { bool retVal = false; + bool success = QMetaObject::invokeMethod(plugin, - "qdsEnterpriseLicense", + "evaluationLicense", Qt::DirectConnection, Q_RETURN_ARG(bool, retVal)); + + if (success && retVal) + return enterprise; + + retVal = false; + + success = QMetaObject::invokeMethod(plugin, + "qdsEnterpriseLicense", + Qt::DirectConnection, + Q_RETURN_ARG(bool, retVal)); if (success && retVal) return enterprise; else |