Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/silentShape into lp:ubuntu-ui-toolkit/staging

Proposed by Cris Dywan
Status: Merged
Approved by: Zoltan Balogh
Approved revision: 1597
Merged at revision: 1617
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/silentShape
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 85 lines (+32/-8)
1 file modified
src/Ubuntu/Components/plugin/ucubuntushape.cpp (+32/-8)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/silentShape
Reviewer Review Type Date Requested Status
Loïc Molinari (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+267347@code.launchpad.net

Commit message

Only fire each UbuntuShape deprecation note once

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Loïc Molinari (loic.molinari) wrote :

Much better ;)

I'd keep the setBorderSource() log commented though.

review: Needs Fixing
1596. By Cris Dywan

Reinstate uncommented warning for setBorderSource

1597. By Cris Dywan

Remove rogue ' from comment

Revision history for this message
Loïc Molinari (loic.molinari) wrote :

Nice.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/Components/plugin/ucubuntushape.cpp'
2--- src/Ubuntu/Components/plugin/ucubuntushape.cpp 2015-08-06 13:16:24 +0000
3+++ src/Ubuntu/Components/plugin/ucubuntushape.cpp 2015-08-07 17:41:55 +0000
4@@ -793,8 +793,12 @@
5 */
6 void UCUbuntuShape::setColor(const QColor& color)
7 {
8- qmlInfo(this) << "'color' is deprecated. Use 'backgroundColor', 'secondaryBackgroundColor' and "
9- "'backgroundMode' instead.";
10+ static bool deprecationNoteShown = false;
11+ if (!deprecationNoteShown) {
12+ deprecationNoteShown = true;
13+ qmlInfo(this) << "'color' is deprecated. Use 'backgroundColor', 'secondaryBackgroundColor' and "
14+ "'backgroundMode' instead.";
15+ }
16
17 if (!(m_flags & BackgroundApiSet)) {
18 const QRgb colorRgb = qRgba(color.red(), color.green(), color.blue(), color.alpha());
19@@ -822,8 +826,12 @@
20 */
21 void UCUbuntuShape::setGradientColor(const QColor& gradientColor)
22 {
23- qmlInfo(this) << "'gradientColor' is deprecated. Use 'backgroundColor', "
24- "'secondaryBackgroundColor' and 'backgroundMode' instead.";
25+ static bool deprecationNoteShown = false;
26+ if (!deprecationNoteShown) {
27+ deprecationNoteShown = true;
28+ qmlInfo(this) << "'gradientColor' is deprecated. Use 'backgroundColor', "
29+ "'secondaryBackgroundColor' and 'backgroundMode' instead.";
30+ }
31
32 if (!(m_flags & BackgroundApiSet)) {
33 m_flags |= GradientColorSet;
34@@ -849,7 +857,11 @@
35 */
36 void UCUbuntuShape::setImage(const QVariant& image)
37 {
38- qmlInfo(this) << "'image' is deprecated. Use 'source' instead.";
39+ static bool deprecationNoteShown = false;
40+ if (!deprecationNoteShown) {
41+ deprecationNoteShown = true;
42+ qmlInfo(this) << "'image' is deprecated. Use 'source' instead.";
43+ }
44
45 if (!(m_flags & SourceApiSet)) {
46 QQuickItem* newImage = qobject_cast<QQuickItem*>(qvariant_cast<QObject*>(image));
47@@ -878,7 +890,11 @@
48 // maintain it for a while for compatibility reasons.
49 void UCUbuntuShape::setStretched(bool stretched)
50 {
51- qmlInfo(this) << "'stretched' is deprecated. Use 'sourceFillMode' instead";
52+ static bool deprecationNoteShown = false;
53+ if (!deprecationNoteShown) {
54+ deprecationNoteShown = true;
55+ qmlInfo(this) << "'stretched' is deprecated. Use 'sourceFillMode' instead";
56+ }
57
58 if (!(m_flags & SourceApiSet)) {
59 if (!!(m_flags & Stretched) != stretched) {
60@@ -897,7 +913,11 @@
61 // Deprecation layer. Same comment as setStretched().
62 void UCUbuntuShape::setHorizontalAlignment(HAlignment horizontalAlignment)
63 {
64- qmlInfo(this) << "'horizontalAlignment' is deprecated. Use 'sourceHorizontalAlignment' instead";
65+ static bool deprecationNoteShown = false;
66+ if (!deprecationNoteShown) {
67+ deprecationNoteShown = true;
68+ qmlInfo(this) << "'horizontalAlignment' is deprecated. Use 'sourceHorizontalAlignment' instead";
69+ }
70
71 if (!(m_flags & SourceApiSet)) {
72 if (m_imageHorizontalAlignment != horizontalAlignment) {
73@@ -912,7 +932,11 @@
74 // Deprecation layer. Same comment as setStretched().
75 void UCUbuntuShape::setVerticalAlignment(VAlignment verticalAlignment)
76 {
77- qmlInfo(this) << "'horizontalAlignment' is deprecated. Use 'sourceVerticalAlignment' instead";
78+ static bool deprecationNoteShown = false;
79+ if (!deprecationNoteShown) {
80+ deprecationNoteShown = true;
81+ qmlInfo(this) << "'horizontalAlignment' is deprecated. Use 'sourceVerticalAlignment' instead";
82+ }
83
84 if (!(m_flags & SourceApiSet)) {
85 if (m_imageVerticalAlignment != verticalAlignment) {

Subscribers

People subscribed via source and target branches