diff --git a/bluez/applet/devicesproxymodel.cpp b/bluez/applet/devicesproxymodel.cpp index 7eb7333..d2c9564 100644 --- a/bluez/applet/devicesproxymodel.cpp +++ b/bluez/applet/devicesproxymodel.cpp @@ -97,6 +97,7 @@ bool DevicesProxyModel::duplicateIndexAddress(const QModelIndex &idx) const 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(); + + return index.data(BluezQt::DevicesModel::AdapterPoweredRole).toBool() && + index.data(BluezQt::DevicesModel::AdapterPairableRole).toBool(); } diff --git a/bluez/bluezqtextensionplugin.cpp b/bluez/bluezqtextensionplugin.cpp index b6e6157..a7693f1 100644 --- a/bluez/bluezqtextensionplugin.cpp +++ b/bluez/bluezqtextensionplugin.cpp @@ -66,8 +66,6 @@ void BluezQtExtensionPlugin::registerTypes(const char *uri) Q_ASSERT(QLatin1String(uri) == QLatin1String("Cutefish.Bluez")); - qmlRegisterType(uri, 1, 0, "DevicesProxyModel"); - qmlRegisterSingletonType(uri, 1, 0, "Manager", manager_singleton); qmlRegisterType(uri, 1, 0, "DevicesModelPrivate"); qmlRegisterUncreatableType(uri, 1, 0, "Adapter", QStringLiteral("Adapter cannot be created")); @@ -78,4 +76,6 @@ void BluezQtExtensionPlugin::registerTypes(const char *uri) qmlRegisterUncreatableType(uri, 1, 0, "PendingCall", QStringLiteral("PendingCall cannot be created")); qmlRegisterUncreatableType(uri, 1, 0, "Rfkill", QStringLiteral("Rfkill cannot be created")); qmlRegisterSingletonType(uri, 1, 0, "Services", services_singleton); + + qmlRegisterType(uri, 1, 0, "DevicesProxyModel"); }