Commit b4ba0dae authored by Nicolas Fella's avatar Nicolas Fella

Show only paired devices in KCM and applet

Currently only paired/known devices are shown initially. Once the user starts the
wizard we enter discover mode and all newly found devices are added to
the model and thus the applet and KCM. When the KCM is closed and opened
again only the paired devices.

To avoid this filter out unpaired devices in the ProxyModel that is used
by the applet and KCM.

BUG: 422383
BUG: 416322
parent 4f99bc3c
......@@ -94,3 +94,9 @@ bool DevicesProxyModel::duplicateIndexAddress(const QModelIndex &idx) const
return list.size() > 1;
}
bool DevicesProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
{
const QModelIndex index = sourceModel()->index(source_row, 0, source_parent);
// Only show paired devices in the KCM and applet
return index.data(BluezQt::DevicesModel::PairedRole).toBool();
}
......@@ -25,6 +25,7 @@ public:
QHash<int, QByteArray> roleNames() const override;
QVariant data(const QModelIndex &index, int role) const override;
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
Q_INVOKABLE QString adapterHciString(const QString &ubi) const;
......
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