Changeset View
Changeset View
Standalone View
Standalone View
containments/desktop/plugins/folder/placesmodel.h
Show All 23 Lines | |||||
24 | 24 | | |||
25 | class KFilePlacesModel; | 25 | class KFilePlacesModel; | ||
26 | 26 | | |||
27 | class PlacesModel : public QSortFilterProxyModel | 27 | class PlacesModel : public QSortFilterProxyModel | ||
28 | { | 28 | { | ||
29 | Q_OBJECT | 29 | Q_OBJECT | ||
30 | 30 | | |||
31 | Q_PROPERTY(bool activityLinkingEnabled READ activityLinkingEnabled CONSTANT) | 31 | Q_PROPERTY(bool activityLinkingEnabled READ activityLinkingEnabled CONSTANT) | ||
32 | Q_PROPERTY(bool showDesktopEntry READ showDesktopEntry WRITE setShowDesktopEntry NOTIFY showDesktopEntryChanged) | ||||
32 | 33 | | |||
33 | public: | 34 | public: | ||
34 | explicit PlacesModel(QObject *parent = nullptr); | 35 | explicit PlacesModel(QObject *parent = nullptr); | ||
35 | ~PlacesModel(); | 36 | ~PlacesModel(); | ||
36 | 37 | | |||
37 | bool activityLinkingEnabled() const; | 38 | bool activityLinkingEnabled() const; | ||
38 | 39 | | |||
40 | bool showDesktopEntry() const; | ||||
41 | void setShowDesktopEntry(bool showDesktopEntry); | ||||
42 | | ||||
39 | QHash<int, QByteArray> roleNames() const override; | 43 | QHash<int, QByteArray> roleNames() const override; | ||
40 | Q_INVOKABLE QString urlForIndex(int idx) const; | 44 | Q_INVOKABLE QString urlForIndex(int idx) const; | ||
41 | Q_INVOKABLE int indexForUrl(const QString &url) const; | 45 | Q_INVOKABLE int indexForUrl(const QString &url) const; | ||
42 | 46 | | |||
43 | Q_SIGNALS: | 47 | Q_SIGNALS: | ||
44 | void placesChanged() const; | 48 | void placesChanged() const; | ||
49 | void showDesktopEntryChanged() const; | ||||
45 | 50 | | |||
46 | protected: | 51 | protected: | ||
47 | bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; | 52 | bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; | ||
48 | 53 | | |||
49 | private: | 54 | private: | ||
50 | KFilePlacesModel *m_sourceModel; | 55 | KFilePlacesModel *m_sourceModel; | ||
56 | bool m_showDesktopEntry = true; | ||||
51 | }; | 57 | }; | ||
52 | 58 | | |||
53 | #endif | 59 | #endif |