StudioWelcome: Expose community edition property

Change-Id: I173576bfaa2ae77f8bf5ee477b1952a30c7de75a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2019-06-04 10:58:23 +02:00
parent ab838b9739
commit e9cde9d6ad
2 changed files with 16 additions and 0 deletions

View File

@@ -26,6 +26,8 @@
import QtQuick 2.0
ListModel {
property bool communityVersion: true
ListElement {
displayName: "Project 01"
prettyFilePath: "my_file_1"

View File

@@ -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