Merge lp:~zsombi/ubuntu-ui-toolkit/fixPaletteChange into lp:ubuntu-ui-toolkit/staging
- fixPaletteChange
- Merge into staging
Status: | Merged |
---|---|
Approved by: | Timo Jyrinki |
Approved revision: | 2106 |
Merged at revision: | 2111 |
Proposed branch: | lp:~zsombi/ubuntu-ui-toolkit/fixPaletteChange |
Merge into: | lp:ubuntu-ui-toolkit/staging |
Diff against target: |
159 lines (+40/-11) 3 files modified
src/UbuntuToolkit/uctheme.cpp (+28/-9) src/UbuntuToolkit/uctheme_p.h (+10/-0) tests/unit/unit.pro (+2/-2) |
To merge this branch: | bzr merge lp:~zsombi/ubuntu-ui-toolkit/fixPaletteChange |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
ubuntu-sdk-build-bot | continuous-integration | Approve | |
Cris Dywan | Approve | ||
Review via email: mp+305986@code.launchpad.net |
Commit message
Fix property binding restore on theme palette values.
Description of the change
Fix property binding restore on theme palette values.
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2106
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2106
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2106
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2106
https:/
Executed test runs:
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
Cris Dywan (kalikiana) wrote : | # |
Niiiiice. Thanks for sorting this out!
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2106
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2106
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2106
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2106
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2106
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Timo Jyrinki (timo-jyrinki) wrote : | # |
Sorry armhf failure because of arale but now the yakkety should be fixed first.
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2106
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2106
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2106
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
ABORTED: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Timo Jyrinki (timo-jyrinki) wrote : | # |
Yakkety tests now fixed ("fixed") with another MP, retopapproving.
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2106
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2106
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2106
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2106
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2106
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | === modified file 'src/UbuntuToolkit/uctheme.cpp' | |||
2 | --- src/UbuntuToolkit/uctheme.cpp 2016-09-09 17:49:07 +0000 | |||
3 | +++ src/UbuntuToolkit/uctheme.cpp 2016-09-16 17:10:32 +0000 | |||
4 | @@ -150,16 +150,19 @@ | |||
5 | 150 | const QString THEME_FOLDER_FORMAT("%1/%2/"); | 150 | const QString THEME_FOLDER_FORMAT("%1/%2/"); |
6 | 151 | const QString PARENT_THEME_FILE("parent_theme"); | 151 | const QString PARENT_THEME_FILE("parent_theme"); |
7 | 152 | 152 | ||
9 | 153 | static inline void updateBinding (QQmlAbstractBinding *binding) | 153 | #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) |
10 | 154 | static inline void updateBinding(const QQmlAbstractBinding::Ptr &binding) | ||
11 | 154 | { | 155 | { |
12 | 155 | #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) | ||
13 | 156 | if (binding->isValueTypeProxy()) | 156 | if (binding->isValueTypeProxy()) |
14 | 157 | return; | 157 | return; |
16 | 158 | static_cast<QQmlBinding *>(binding)->update(); | 158 | static_cast<QQmlBinding*>(binding.data())->update(); |
17 | 159 | } | ||
18 | 159 | #else | 160 | #else |
20 | 160 | binding->update(); | 161 | static inline void updateBinding (const QQmlAbstractBinding *binding) |
21 | 162 | { | ||
22 | 163 | const_cast<QQmlAbstractBinding*>(binding)->update(); | ||
23 | 164 | } | ||
24 | 161 | #endif | 165 | #endif |
25 | 162 | } | ||
26 | 163 | 166 | ||
27 | 164 | QStringList themeSearchPath() | 167 | QStringList themeSearchPath() |
28 | 165 | { | 168 | { |
29 | @@ -263,11 +266,14 @@ | |||
30 | 263 | // restore the config binding to the config target | 266 | // restore the config binding to the config target |
31 | 264 | #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) | 267 | #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) |
32 | 265 | if (config.configBinding && !config.configBinding->isValueTypeProxy()) { | 268 | if (config.configBinding && !config.configBinding->isValueTypeProxy()) { |
33 | 269 | QQmlBinding *qmlBinding = static_cast<QQmlBinding*>(config.configBinding.data()); | ||
34 | 270 | qmlBinding->removeFromObject(); | ||
35 | 271 | QQmlPropertyPrivate::removeBinding(config.paletteProperty); | ||
36 | 266 | #else | 272 | #else |
37 | 267 | if (config.configBinding && config.configBinding->bindingType() == QQmlAbstractBinding::Binding) { | 273 | if (config.configBinding && config.configBinding->bindingType() == QQmlAbstractBinding::Binding) { |
38 | 268 | #endif | ||
39 | 269 | QQmlBinding *qmlBinding = static_cast<QQmlBinding*>(config.configBinding); | 274 | QQmlBinding *qmlBinding = static_cast<QQmlBinding*>(config.configBinding); |
40 | 270 | qmlBinding->removeFromObject(); | 275 | qmlBinding->removeFromObject(); |
41 | 276 | #endif | ||
42 | 271 | qmlBinding->setTarget(config.configProperty); | 277 | qmlBinding->setTarget(config.configProperty); |
43 | 272 | } | 278 | } |
44 | 273 | 279 | ||
45 | @@ -275,7 +281,7 @@ | |||
46 | 275 | // restore the binding to the palette | 281 | // restore the binding to the palette |
47 | 276 | #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) | 282 | #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) |
48 | 277 | QQmlAbstractBinding::Ptr prev(QQmlPropertyPrivate::binding(config.paletteProperty)); | 283 | QQmlAbstractBinding::Ptr prev(QQmlPropertyPrivate::binding(config.paletteProperty)); |
50 | 278 | QQmlPropertyPrivate::setBinding(config.paletteProperty, config.paletteBinding); | 284 | QQmlPropertyPrivate::setBinding(config.paletteProperty, config.paletteBinding.data()); |
51 | 279 | #else | 285 | #else |
52 | 280 | QQmlAbstractBinding *prev = QQmlPropertyPrivate::setBinding(config.paletteProperty, config.paletteBinding); | 286 | QQmlAbstractBinding *prev = QQmlPropertyPrivate::setBinding(config.paletteProperty, config.paletteBinding); |
53 | 281 | #endif | 287 | #endif |
54 | @@ -293,7 +299,7 @@ | |||
55 | 293 | } | 299 | } |
56 | 294 | 300 | ||
57 | 295 | config.paletteProperty = QQmlProperty(); | 301 | config.paletteProperty = QQmlProperty(); |
59 | 296 | config.paletteBinding = NULL; | 302 | config.paletteBinding = Q_NULLPTR; |
60 | 297 | config.paletteValue.clear(); | 303 | config.paletteValue.clear(); |
61 | 298 | } | 304 | } |
62 | 299 | 305 | ||
63 | @@ -346,6 +352,10 @@ | |||
64 | 346 | config.paletteBinding = QQmlPropertyPrivate::binding(config.paletteProperty); | 352 | config.paletteBinding = QQmlPropertyPrivate::binding(config.paletteProperty); |
65 | 347 | if (!config.paletteBinding) { | 353 | if (!config.paletteBinding) { |
66 | 348 | config.paletteValue = config.paletteProperty.read(); | 354 | config.paletteValue = config.paletteProperty.read(); |
67 | 355 | #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) | ||
68 | 356 | } else { | ||
69 | 357 | QQmlPropertyPrivate::removeBinding(config.paletteProperty); | ||
70 | 358 | #endif | ||
71 | 349 | } | 359 | } |
72 | 350 | 360 | ||
73 | 351 | // apply configuration | 361 | // apply configuration |
74 | @@ -353,17 +363,26 @@ | |||
75 | 353 | // transfer binding's target | 363 | // transfer binding's target |
76 | 354 | #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) | 364 | #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) |
77 | 355 | if (!config.configBinding->isValueTypeProxy()) { | 365 | if (!config.configBinding->isValueTypeProxy()) { |
78 | 366 | QQmlBinding *qmlBinding = static_cast<QQmlBinding*>(config.configBinding.data()); | ||
79 | 356 | #else | 367 | #else |
80 | 357 | if (config.configBinding->bindingType() == QQmlAbstractBinding::Binding) { | 368 | if (config.configBinding->bindingType() == QQmlAbstractBinding::Binding) { |
81 | 358 | #endif | ||
82 | 359 | QQmlBinding *qmlBinding = static_cast<QQmlBinding*>(config.configBinding); | 369 | QQmlBinding *qmlBinding = static_cast<QQmlBinding*>(config.configBinding); |
83 | 370 | #endif | ||
84 | 360 | qmlBinding->setTarget(config.paletteProperty); | 371 | qmlBinding->setTarget(config.paletteProperty); |
85 | 361 | } | 372 | } |
86 | 373 | #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) | ||
87 | 374 | QQmlPropertyPrivate::setBinding(config.paletteProperty, config.configBinding.data()); | ||
88 | 375 | #else | ||
89 | 362 | QQmlPropertyPrivate::setBinding(config.paletteProperty, config.configBinding); | 376 | QQmlPropertyPrivate::setBinding(config.paletteProperty, config.configBinding); |
90 | 377 | #endif | ||
91 | 363 | } else { | 378 | } else { |
92 | 364 | if (config.paletteBinding) { | 379 | if (config.paletteBinding) { |
93 | 380 | #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) | ||
94 | 381 | QQmlPropertyPrivate::removeBinding(config.paletteProperty); | ||
95 | 382 | #else | ||
96 | 365 | // remove binding so the property doesn't clear it | 383 | // remove binding so the property doesn't clear it |
97 | 366 | QQmlPropertyPrivate::setBinding(config.paletteProperty, 0); | 384 | QQmlPropertyPrivate::setBinding(config.paletteProperty, 0); |
98 | 385 | #endif | ||
99 | 367 | } | 386 | } |
100 | 368 | config.paletteProperty.write(config.configProperty.read()); | 387 | config.paletteProperty.write(config.configProperty.read()); |
101 | 369 | } | 388 | } |
102 | 370 | 389 | ||
103 | === modified file 'src/UbuntuToolkit/uctheme_p.h' | |||
104 | --- src/UbuntuToolkit/uctheme_p.h 2016-09-09 17:49:07 +0000 | |||
105 | +++ src/UbuntuToolkit/uctheme_p.h 2016-09-16 17:10:32 +0000 | |||
106 | @@ -27,12 +27,17 @@ | |||
107 | 27 | #include <QtQml/QQmlComponent> | 27 | #include <QtQml/QQmlComponent> |
108 | 28 | #include <QtQml/QQmlParserStatus> | 28 | #include <QtQml/QQmlParserStatus> |
109 | 29 | #include <QtQml/QQmlProperty> | 29 | #include <QtQml/QQmlProperty> |
110 | 30 | #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) | ||
111 | 31 | #include <QtQml/private/qqmlabstractbinding_p.h> | ||
112 | 32 | #endif | ||
113 | 30 | #include <QtQml/private/qpodvector_p.h> | 33 | #include <QtQml/private/qpodvector_p.h> |
114 | 31 | 34 | ||
115 | 32 | #include <UbuntuToolkit/ubuntutoolkitglobal.h> | 35 | #include <UbuntuToolkit/ubuntutoolkitglobal.h> |
116 | 33 | #include <UbuntuToolkit/private/ucdefaulttheme_p.h> | 36 | #include <UbuntuToolkit/private/ucdefaulttheme_p.h> |
117 | 34 | 37 | ||
118 | 38 | #if QT_VERSION < QT_VERSION_CHECK(5, 6, 0) | ||
119 | 35 | class QQmlAbstractBinding; | 39 | class QQmlAbstractBinding; |
120 | 40 | #endif | ||
121 | 36 | class QQuickItem; | 41 | class QQuickItem; |
122 | 37 | 42 | ||
123 | 38 | UT_NAMESPACE_BEGIN | 43 | UT_NAMESPACE_BEGIN |
124 | @@ -148,8 +153,13 @@ | |||
125 | 148 | QQmlProperty configProperty; | 153 | QQmlProperty configProperty; |
126 | 149 | QQmlProperty paletteProperty; | 154 | QQmlProperty paletteProperty; |
127 | 150 | QVariant paletteValue; | 155 | QVariant paletteValue; |
128 | 156 | #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) | ||
129 | 157 | QQmlAbstractBinding::Ptr configBinding; | ||
130 | 158 | QQmlAbstractBinding::Ptr paletteBinding; | ||
131 | 159 | #else | ||
132 | 151 | QQmlAbstractBinding *configBinding; | 160 | QQmlAbstractBinding *configBinding; |
133 | 152 | QQmlAbstractBinding *paletteBinding; | 161 | QQmlAbstractBinding *paletteBinding; |
134 | 162 | #endif | ||
135 | 153 | }; | 163 | }; |
136 | 154 | 164 | ||
137 | 155 | // configuration palette, not the original theme one | 165 | // configuration palette, not the original theme one |
138 | 156 | 166 | ||
139 | === modified file 'tests/unit/unit.pro' | |||
140 | --- tests/unit/unit.pro 2016-09-16 11:13:32 +0000 | |||
141 | +++ tests/unit/unit.pro 2016-09-16 17:10:32 +0000 | |||
142 | @@ -29,7 +29,7 @@ | |||
143 | 29 | mousefilters \ | 29 | mousefilters \ |
144 | 30 | animator \ | 30 | animator \ |
145 | 31 | serviceproperties \ | 31 | serviceproperties \ |
147 | 32 | # subtheming \ # FIXME: Breaks with Qt 5.6. See bug #1570478. | 32 | subtheming \ |
148 | 33 | swipearea \ | 33 | swipearea \ |
149 | 34 | touchregistry \ | 34 | touchregistry \ |
150 | 35 | bottomedge \ | 35 | bottomedge \ |
151 | @@ -38,7 +38,7 @@ | |||
152 | 38 | units \ | 38 | units \ |
153 | 39 | scaling_image_provider \ | 39 | scaling_image_provider \ |
154 | 40 | qquick_image_extension \ | 40 | qquick_image_extension \ |
156 | 41 | # performance \ # FIXME: Breaks with Qt 5.6. See bug #1570478. | 41 | performance \ |
157 | 42 | mainview \ | 42 | mainview \ |
158 | 43 | i18n \ | 43 | i18n \ |
159 | 44 | arguments \ | 44 | arguments \ |
PASSED: Continuous integration, rev:2106 /jenkins. ubuntu. com/ubuntu- sdk/job/ ubuntu- ui-toolkit- ci-amd64- devel/1209/ /jenkins. ubuntu. com/ubuntu- sdk/job/ generic- update- mp/6408/ console
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild: /jenkins. ubuntu. com/ubuntu- sdk/job/ ubuntu- ui-toolkit- ci-amd64- devel/1209/ rebuild
https:/