forked from qt-creator/qt-creator
StudioWelcome: Expose community edition property
Change-Id: I173576bfaa2ae77f8bf5ee477b1952a30c7de75a Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -26,6 +26,8 @@
|
|||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
|
||||||
ListModel {
|
ListModel {
|
||||||
|
|
||||||
|
property bool communityVersion: true
|
||||||
ListElement {
|
ListElement {
|
||||||
displayName: "Project 01"
|
displayName: "Project 01"
|
||||||
prettyFilePath: "my_file_1"
|
prettyFilePath: "my_file_1"
|
||||||
|
@@ -67,6 +67,8 @@ class ProjectModel : public QAbstractListModel
|
|||||||
public:
|
public:
|
||||||
enum { FilePathRole = Qt::UserRole+1, PrettyFilePathRole };
|
enum { FilePathRole = Qt::UserRole+1, PrettyFilePathRole };
|
||||||
|
|
||||||
|
Q_PROPERTY(bool communityVersion MEMBER m_communityVersion NOTIFY communityVersionChanged)
|
||||||
|
|
||||||
explicit ProjectModel(QObject *parent = nullptr);
|
explicit ProjectModel(QObject *parent = nullptr);
|
||||||
|
|
||||||
int rowCount(const QModelIndex &parent) const override;
|
int rowCount(const QModelIndex &parent) const override;
|
||||||
@@ -104,6 +106,12 @@ public:
|
|||||||
}
|
}
|
||||||
public slots:
|
public slots:
|
||||||
void resetProjects();
|
void resetProjects();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void communityVersionChanged();
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool m_communityVersion = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
ProjectModel::ProjectModel(QObject *parent)
|
ProjectModel::ProjectModel(QObject *parent)
|
||||||
@@ -113,6 +121,12 @@ ProjectModel::ProjectModel(QObject *parent)
|
|||||||
&ProjectExplorer::ProjectExplorerPlugin::recentProjectsChanged,
|
&ProjectExplorer::ProjectExplorerPlugin::recentProjectsChanged,
|
||||||
this,
|
this,
|
||||||
&ProjectModel::resetProjects);
|
&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
|
int ProjectModel::rowCount(const QModelIndex &) const
|
||||||
|
Reference in New Issue
Block a user