Merge lp:~cyphermox/ubuntu-system-settings/address-not-name-rtm into lp:ubuntu-system-settings/rtm-14.09

Proposed by Mathieu Trudel-Lapierre
Status: Merged
Approved by: Ken VanDine
Approved revision: 989
Merged at revision: 992
Proposed branch: lp:~cyphermox/ubuntu-system-settings/address-not-name-rtm
Merge into: lp:ubuntu-system-settings/rtm-14.09
Diff against target: 24 lines (+10/-1)
1 file modified
plugins/bluetooth/devicemodel.cpp (+10/-1)
To merge this branch: bzr merge lp:~cyphermox/ubuntu-system-settings/address-not-name-rtm
Reviewer Review Type Date Requested Status
Ken VanDine Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+249901@code.launchpad.net

Commit message

Use the address instead of name in main device list if name isn't available.

Description of the change

Use the address instead of name in main device list if name isn't available.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Thanks

review: Approve
990. By Mathieu Trudel-Lapierre

Fix logic error in check for Paired to know if we should add ellipsis.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/bluetooth/devicemodel.cpp'
2--- plugins/bluetooth/devicemodel.cpp 2014-11-18 19:37:24 +0000
3+++ plugins/bluetooth/devicemodel.cpp 2015-02-18 15:10:35 +0000
4@@ -537,10 +537,19 @@
5 if ((0<=index.row()) && (index.row()<m_devices.size())) {
6
7 auto device = m_devices[index.row()];
8+ QString displayName;
9
10 switch (role) {
11 case Qt::DisplayRole:
12- ret = device->isPaired() ? device->getName() : device->getName() + "…";
13+ displayName = device->getName();
14+
15+ if (displayName.isEmpty())
16+ displayName = device->getAddress();
17+
18+ if (!device->isPaired())
19+ displayName.append("…");
20+
21+ ret = displayName;
22 break;
23
24 case IconRole:

Subscribers

People subscribed via source and target branches