Merge lp:~lukas-kde/ubuntu-system-settings/ap-signal-strength into lp:ubuntu-system-settings

Proposed by Lukáš Tinkl
Status: Merged
Approved by: Jonas G. Drange
Approved revision: 1751
Merged at revision: 1758
Proposed branch: lp:~lukas-kde/ubuntu-system-settings/ap-signal-strength
Merge into: lp:ubuntu-system-settings
Diff against target: 30 lines (+11/-2)
1 file modified
plugins/wifi/MenuItemFactory.qml (+11/-2)
To merge this branch: bzr merge lp:~lukas-kde/ubuntu-system-settings/ap-signal-strength
Reviewer Review Type Date Requested Status
Jonas G. Drange (community) Approve
Review via email: mp+313370@code.launchpad.net

Commit message

Fix WIFI APs signal strength icons

Description of the change

Fix WIFI APs signal strength icons

Correctly handle both uchar (byte on DBUS) and integers when evaluating the strength and converting it to an integer.

To post a comment you must log in.
Revision history for this message
Jonas G. Drange (jonas-drange) wrote :

great, thank you!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/wifi/MenuItemFactory.qml'
2--- plugins/wifi/MenuItemFactory.qml 2016-07-14 13:51:56 +0000
3+++ plugins/wifi/MenuItemFactory.qml 2016-12-15 15:16:19 +0000
4@@ -130,7 +130,7 @@
5 property var menuModel: menuFactory.model
6 property int menuIndex: -1
7 property var extendedData: menu && menu.ext || undefined
8- property var strenthAction: QMenuModel.UnityMenuAction {
9+ property var strengthAction: QMenuModel.UnityMenuAction {
10 model: menuModel ? menuModel : null
11 name: getExtendedProperty(extendedData, "xCanonicalWifiApStrengthAction", "")
12 }
13@@ -140,7 +140,16 @@
14 secure: getExtendedProperty(extendedData, "xCanonicalWifiApIsSecure", false)
15 adHoc: getExtendedProperty(extendedData, "xCanonicalWifiApIsAdhoc", false)
16 checked: serverChecked
17- signalStrength: strenthAction.valid ? strenthAction.state : 0
18+ signalStrength: {
19+ if (strengthAction.valid) {
20+ var state = strengthAction.state; // handle both int and uchar
21+ if (typeof state == "string") {
22+ return state.charCodeAt();
23+ }
24+ return state;
25+ }
26+ return 0;
27+ }
28 enabled: menu ? menu.sensitive : false
29
30 onMenuModelChanged: {

Subscribers

People subscribed via source and target branches