Expose flags so that the plasmoid doesn't need to use magic numbers

This commit is contained in:
Aleix Pol 2014-06-27 16:09:01 +02:00
parent 5379bba551
commit e227c61cf8
2 changed files with 4 additions and 3 deletions

View file

@ -35,7 +35,7 @@ class KDECONNECTINTERFACES_EXPORT DevicesModel
: public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(int displayFilter READ displayFilter WRITE setDisplayFilter)
Q_PROPERTY(StatusFlags displayFilter READ displayFilter WRITE setDisplayFilter)
Q_PROPERTY(int count READ rowCount NOTIFY rowsChanged)
public:
@ -47,11 +47,12 @@ public:
IconNameRole,
IsPairedRole
};
enum StatusFlags {
enum StatusFlag {
StatusUnknown = 0x00,
StatusPaired = 0x01,
StatusReachable = 0x02
};
Q_DECLARE_FLAGS(StatusFlags, StatusFlag)
DevicesModel(QObject *parent = 0);
virtual ~DevicesModel();

View file

@ -68,7 +68,7 @@ Item {
anchors.fill: parent
model: KdeConnect.DevicesModel {
id: connectDeviceModel
displayFilter: 3
displayFilter: StatusPaired | StatusReachable
}
delegate: DeviceDelegate { }
onCountChanged: shouldPlasmoidBeShown()