diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2019-06-04 10:58:23 +0200 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2019-06-05 12:10:34 +0000 |
commit | e9cde9d6ad58c7607a197d3a945b19e07dbd43ff (patch) | |
tree | baeb76b329be28e40c53addb56e4bb8f1c5633f1 /src/plugins/studiowelcome | |
parent | ab838b9739f8cf8be9854519e404a97bf235c7b4 (diff) |
StudioWelcome: Expose community edition property
Change-Id: I173576bfaa2ae77f8bf5ee477b1952a30c7de75a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/plugins/studiowelcome')
-rw-r--r-- | src/plugins/studiowelcome/qml/welcomepage/mockData/projectmodel/ProjectModel.qml | 2 | ||||
-rw-r--r-- | src/plugins/studiowelcome/studiowelcomeplugin.cpp | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/studiowelcome/qml/welcomepage/mockData/projectmodel/ProjectModel.qml b/src/plugins/studiowelcome/qml/welcomepage/mockData/projectmodel/ProjectModel.qml index d0524f3b46..bca1783d42 100644 --- a/src/plugins/studiowelcome/qml/welcomepage/mockData/projectmodel/ProjectModel.qml +++ b/src/plugins/studiowelcome/qml/welcomepage/mockData/projectmodel/ProjectModel.qml @@ -26,6 +26,8 @@ import QtQuick 2.0 ListModel { + + property bool communityVersion: true ListElement { displayName: "Project 01" prettyFilePath: "my_file_1" diff --git a/src/plugins/studiowelcome/studiowelcomeplugin.cpp b/src/plugins/studiowelcome/studiowelcomeplugin.cpp index 1064b5cf1b..864acf4e83 100644 --- a/src/plugins/studiowelcome/studiowelcomeplugin.cpp +++ b/src/plugins/studiowelcome/studiowelcomeplugin.cpp @@ -67,6 +67,8 @@ class ProjectModel : public QAbstractListModel public: enum { FilePathRole = Qt::UserRole+1, PrettyFilePathRole }; + Q_PROPERTY(bool communityVersion MEMBER m_communityVersion NOTIFY communityVersionChanged) + explicit ProjectModel(QObject *parent = nullptr); int rowCount(const QModelIndex &parent) const override; @@ -104,6 +106,12 @@ public: } public slots: void resetProjects(); + +signals: + void communityVersionChanged(); + +private: + bool m_communityVersion = false; }; ProjectModel::ProjectModel(QObject *parent) @@ -113,6 +121,12 @@ ProjectModel::ProjectModel(QObject *parent) &ProjectExplorer::ProjectExplorerPlugin::recentProjectsChanged, this, &ProjectModel::resetProjects); + +#ifdef LICENSECHECKER + if (!Utils::findOrDefault(ExtensionSystem::PluginManager::plugins(), + Utils::equal(&ExtensionSystem::PluginSpec::name, QString("LicenseChecker")))) + m_communityVersion = true; +#endif } int ProjectModel::rowCount(const QModelIndex &) const |