Merge lp:~larsu/gsettings-qt/lp1503693 into lp:gsettings-qt
| Status: | Merged |
|---|---|
| Approved by: | Albert Astals Cid on 2015-11-04 |
| Approved revision: | 75 |
| Merged at revision: | 74 |
| Proposed branch: | lp:~larsu/gsettings-qt/lp1503693 |
| Merge into: | lp:gsettings-qt |
| Diff against target: |
49 lines (+16/-2) 2 files modified
GSettings/gsettings-qml.cpp (+13/-1) tests/tst_GSettings.qml (+3/-1) |
| To merge this branch: | bzr merge lp:~larsu/gsettings-qt/lp1503693 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Albert Astals Cid (community) | 2015-10-29 | Approve on 2015-11-04 | |
|
Review via email:
|
|||
Commit Message
qgsettings-qml: explicitly emit changed events
We're working around QTBUG-32859 by not dispatching changed signals
directly. This leads to two issues:
1. Changed signals are not emitted by GSettingsQml, because it only
emits those when the value is different from its cached one, which is
already updated by the time the queued signal arrives.
2. Calling schema.reset() from qml and immediately fetching the value
after returns the old value, because the value was only updated when the
signal arrives.
Fix these by explicitly emitting the changed signal when setting the
value from qml (the later one is then ignored) and setting the cached
value when calling reset().
Also, remove changesSpy from test_reset(), because that now counts
changes correctly and includes the ones from previous tests.
This patch can be reverted once the Qt bug is fixed.
Description of the Change
qgsettings-qml: explicitly emit changed events
- 75. By Lars Karlitski on 2015-11-04
-
qml tests: put changesSpy back
To check that the signal gets emitted when a key is reset.
| Lars Karlitski (larsu) wrote : | # |
> any reason you removed the signalspy? i think it's good checking that reset
> does actually trigger the signal too, proves that qml will re-evaluate things
> that depend on it, something like
>
> changesSpy.clear();
> settings.
> tryCompare(
>
> What do you think?
Good point. I removed it because it was counting the emitted signals for all tests. Didn't think about looking at the docs to find something like "clear". Thanks!
| Albert Astals Cid (aacid) wrote : | # |
It's non ideal but since fixing that bug in qt is much harder than this, let's approve this and hope they fix the bug in qt at some point.

any reason you removed the signalspy? i think it's good checking that reset does actually trigger the signal too, proves that qml will re-evaluate things that depend on it, something like
changesSpy. clear() ; schema. reset(' testInteger' ); changesSpy, "count", 1);
settings.
tryCompare(
What do you think?