forked from qt-creator/qt-creator
Factor out license check.
Change-Id: Ifcaab7252239bde1affa8bc55ab38761c0f6e99f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "clangstaticanalyzerconfigwidget.h"
|
||||
#include "clangstaticanalyzerconstants.h"
|
||||
#include "clangstaticanalyzerlicensecheck.h"
|
||||
#include "clangstaticanalyzerprojectsettingswidget.h"
|
||||
#include "clangstaticanalyzerruncontrolfactory.h"
|
||||
#include "clangstaticanalyzertool.h"
|
||||
@@ -38,12 +39,6 @@
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
#include <projectexplorer/projectpanelfactory.h>
|
||||
|
||||
#ifdef LICENSECHECKER
|
||||
#include <licensechecker/licensecheckerplugin.h>
|
||||
#endif
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <QAction>
|
||||
#include <QDebug>
|
||||
#include <QMainWindow>
|
||||
@@ -117,21 +112,7 @@ bool ClangStaticAnalyzerPlugin::initialize(const QStringList &arguments, QString
|
||||
panelFactory->setDisplayName(tr("Clang Static Analyzer Settings"));
|
||||
panelFactory->setSimpleCreateWidgetFunction<ProjectSettingsWidget>(QIcon());
|
||||
ProjectExplorer::ProjectPanelFactory::registerFactory(panelFactory);
|
||||
|
||||
#ifdef LICENSECHECKER
|
||||
LicenseChecker::LicenseCheckerPlugin *licenseChecker
|
||||
= ExtensionSystem::PluginManager::getObject<LicenseChecker::LicenseCheckerPlugin>();
|
||||
|
||||
if (licenseChecker && licenseChecker->hasValidLicense()) {
|
||||
if (licenseChecker->enterpriseFeatures())
|
||||
return initializeEnterpriseFeatures(arguments, errorString);
|
||||
} else {
|
||||
qWarning() << "Invalid license, disabling Clang Static Analyzer";
|
||||
}
|
||||
return true;
|
||||
#else // LICENSECHECKER
|
||||
return initializeEnterpriseFeatures(arguments, errorString);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool ClangStaticAnalyzerPlugin::initializeEnterpriseFeatures(const QStringList &arguments,
|
||||
@@ -140,6 +121,9 @@ bool ClangStaticAnalyzerPlugin::initializeEnterpriseFeatures(const QStringList &
|
||||
Q_UNUSED(arguments);
|
||||
Q_UNUSED(errorString);
|
||||
|
||||
if (!enterpriseFeaturesAvailable())
|
||||
return true;
|
||||
|
||||
auto tool = m_analyzerTool = new ClangStaticAnalyzerTool(this);
|
||||
addAutoReleasedObject(new ClangStaticAnalyzerRunControlFactory(m_analyzerTool));
|
||||
addAutoReleasedObject(new ClangStaticAnalyzerOptionsPage);
|
||||
|
||||
Reference in New Issue
Block a user