NetworkingStatus document is wrong

Bug #1443223 reported by XiaoGuo, Liu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu UI Toolkit
New
Undecided
Unassigned

Bug Description

I just checked the document:

https://developer.ubuntu.com/api/qml/sdk-14.10/Ubuntu.Connectivity.NetworkingStatus/

The following code is not right:

 Connections {
        target: NetworkingStatus
        // full status can be retrieved from the base C++ class
        // status property
        onStatusChanged: {
            if (status === NetworkingStatus.Offline)
                console.log("Status: Offline")
            if (status === NetworkingStatus.Connecting)
                console.log("Status: Connecting")
            if (status === NetworkingStatus.Online)
                console.log("Status: Online")
        }
    }

The correct one would be:

   Connections {
        target: NetworkingStatus
        // full status can be retrieved from the base C++ class
        // status property
        onStatusChanged: {
            console.log("name: " + value );

            if (value === NetworkingStatus.Offline)
                console.log("Status: Offline")
            if (value === NetworkingStatus.Connecting)
                console.log("Status: Connecting")
            if (value === NetworkingStatus.Online)
                console.log("Status: Online")
        }
    }

which means "status" should be changed to "value" instead.

David Planella (dpm)
affects: developer-ubuntu-com → ubuntu-ui-toolkit
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.