From dc2f9c0f3ca4b1cbb061045ae7ac8741882d8e5e Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Mon, 23 Jun 2014 18:13:43 +0200 Subject: [PATCH] Introduce a IsPaired role in the DevicesModel Reviewed by Albert Vaca --- interfaces/devicesmodel.cpp | 2 ++ interfaces/devicesmodel.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/interfaces/devicesmodel.cpp b/interfaces/devicesmodel.cpp index 8242107cb..479a1d169 100644 --- a/interfaces/devicesmodel.cpp +++ b/interfaces/devicesmodel.cpp @@ -170,6 +170,8 @@ QVariant DevicesModel::data(const QModelIndex& index, int role) const } case IconNameRole: return device->iconName(); + case IsPairedRole: + return QVariant::fromValue(device->isPaired()); default: return QVariant(); } diff --git a/interfaces/devicesmodel.h b/interfaces/devicesmodel.h index 15bcb6734..e8e6590ff 100644 --- a/interfaces/devicesmodel.h +++ b/interfaces/devicesmodel.h @@ -44,7 +44,8 @@ public: IconModelRole = Qt::DecorationRole, StatusModelRole = Qt::InitialSortOrderRole, IdModelRole = Qt::UserRole, - IconNameRole + IconNameRole, + IsPairedRole }; enum StatusFlags { StatusUnknown = 0x00,