units.gu() emits changed signal before completion
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-ui-toolkit (Ubuntu) |
Fix Released
|
Undecided
|
Cris Dywan |
Bug Description
Consider this snippet of code:
-------
import QtQuick 2.4
import Ubuntu.Components 1.3
Item {
property int bla: units.gu(10)
onBlaChanged: print("bla changed", bla);
property int blubb: 80
onBlubbChanged: print("blubb changed", blubb);
Component.
}
-------
The output of this is:
qml: bla changed 80
qml: completed 80
the changed signal should not be emitted before completion, given it is its initial value and not actually changed.
The current behavior triggers all the onChanged handlers when there's units.gu() involved, which results in things like change animations being played at startup and lots of wasted cpu cycles for evaluating all those changed events.
Related branches
- ubuntu-sdk-build-bot: Approve (continuous-integration)
- Zsombor Egri: Approve
- Loïc Molinari (community): Approve
-
Diff: 790 lines (+606/-11)15 files modifiedsrc/UbuntuToolkit/UbuntuToolkit.pro (+3/-0)
src/UbuntuToolkit/ubuntutoolkitmodule.cpp (+2/-0)
src/UbuntuToolkit/ucmainviewbase.cpp (+1/-0)
src/UbuntuToolkit/ucmainwindow.cpp (+215/-0)
src/UbuntuToolkit/ucmainwindow_p.h (+73/-0)
src/UbuntuToolkit/ucmainwindow_p_p.h (+47/-0)
src/UbuntuToolkit/ucunits.cpp (+32/-6)
src/UbuntuToolkit/ucunits_p.h (+5/-0)
tests/autopilot/ubuntuuitoolkit/tests/test_launcher.mainwindow.qml (+12/-5)
tests/autopilot/ubuntuuitoolkit/tests/test_launcher.py (+12/-0)
tests/autopilot/ubuntuuitoolkit/tests/test_launcher.window.qml (+43/-0)
tests/unit/mainwindow/AppName.qml (+28/-0)
tests/unit/mainwindow/mainwindow.pro (+5/-0)
tests/unit/mainwindow/tst_mainwindow.cpp (+127/-0)
tests/unit/unit.pro (+1/-0)
description: | updated |
tags: | added: unity8 |
Changed in ubuntu-ui-toolkit (Ubuntu): | |
assignee: | nobody → Christian Dywan (kalikiana) |
status: | Confirmed → In Progress |
Status changed to 'Confirmed' because the bug affects multiple users.