Commit e227c61c authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

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

parent 5379bba5
......@@ -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();
......
......@@ -68,7 +68,7 @@ Item {
anchors.fill: parent
model: KdeConnect.DevicesModel {
id: connectDeviceModel
displayFilter: 3
displayFilter: StatusPaired | StatusReachable
}
delegate: DeviceDelegate { }
onCountChanged: shouldPlasmoidBeShown()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment