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

Proposed by Cris Dywan
Status: Merged
Approved by: Cris Dywan
Approved revision: 1745
Merged at revision: 1763
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/overrideStateMessageOnce
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 150 lines (+24/-28)
5 files modified
src/Ubuntu/Components/plugin/ucbottomedgehint.cpp (+2/-1)
src/Ubuntu/Components/plugin/uclabel.cpp (+2/-8)
src/Ubuntu/Components/plugin/ucnamespace.h (+11/-0)
src/Ubuntu/Components/plugin/ucubuntushape.cpp (+8/-18)
tests/unit/runtest.sh (+1/-1)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/overrideStateMessageOnce
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Zsombor Egri Approve
Review via email: mp+279742@code.launchpad.net

Commit message

Surround state overloading message with static boolean

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Zsombor Egri (zsombi) wrote :

Now the unit test on BottomEdgeHint fails. Seems the warning doesn't come at all.

review: Approve
Revision history for this message
Zsombor Egri (zsombi) :
review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Zsombor Egri (zsombi) wrote :

That Q_UNUSED is weird for the compiler... Anyways, now it looks good.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1745. By Cris Dywan

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

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/Components/plugin/ucbottomedgehint.cpp'
2--- src/Ubuntu/Components/plugin/ucbottomedgehint.cpp 2015-12-13 07:48:56 +0000
3+++ src/Ubuntu/Components/plugin/ucbottomedgehint.cpp 2015-12-14 16:05:47 +0000
4@@ -20,6 +20,7 @@
5 #include "ucbottomedgehint_p.h"
6 #include "ucstyleditembase_p.h"
7 #include "quickutils.h"
8+#include "ucnamespace.h"
9 #include "ucunits.h"
10 #include "ucaction.h"
11 #include "gestures/ucswipearea.h"
12@@ -338,8 +339,8 @@
13 void UCBottomEdgeHint::setState(const QString &state)
14 {
15 QQuickItem::setState(state);
16+ UC_QML_DEPRECATION_WARNING("Overloaded 'state' property deprecated, will be removed from 1.3 release. Use 'status' instead.");
17
18- qmlInfo(this) << "Overloaded 'state' property deprecated, will be removed from 1.3 release. Use 'status' instead.";
19 Q_D(UCBottomEdgeHint);
20 QQuickItem *style = d->styleItem;
21 if (!style) {
22
23=== modified file 'src/Ubuntu/Components/plugin/uclabel.cpp'
24--- src/Ubuntu/Components/plugin/uclabel.cpp 2015-10-20 10:19:10 +0000
25+++ src/Ubuntu/Components/plugin/uclabel.cpp 2015-12-14 16:05:47 +0000
26@@ -16,9 +16,9 @@
27
28 #include "uclabel.h"
29 #include "ucfontutils.h"
30+#include "ucnamespace.h"
31 #include "ucunits.h"
32 #include "uctheme.h"
33-#include "quickutils.h"
34
35 void UCLabel::updatePixelSize()
36 {
37@@ -172,13 +172,7 @@
38 return;
39 }
40
41- static bool logOnce = false;
42- if (!logOnce) {
43- logOnce = true;
44- if (QuickUtils::showDeprecationWarnings()) {
45- qmlInfo(this) << "'fontSize' is deprecated, use 'textSize' property instead.";
46- }
47- }
48+ UC_QML_DEPRECATION_WARNING("'fontSize' is deprecated, use 'textSize' property instead.");
49
50 TextSize textSize;
51 switch (SCALE_CODE(fontSize)) {
52
53=== modified file 'src/Ubuntu/Components/plugin/ucnamespace.h'
54--- src/Ubuntu/Components/plugin/ucnamespace.h 2015-04-25 05:31:43 +0000
55+++ src/Ubuntu/Components/plugin/ucnamespace.h 2015-12-14 16:05:47 +0000
56@@ -19,12 +19,23 @@
57 #define UCNAMESPACE_H
58
59 #include <QtCore/QObject>
60+#include "quickutils.h"
61
62 #define BUILD_VERSION(major, minor) ((((major) & 0x00FF) << 8) | ((minor) & 0x00FF))
63 #define LATEST_UITK_VERSION BUILD_VERSION(1, 3)
64 #define MAJOR_VERSION(version) ((version) >> 8)
65 #define MINOR_VERSION(version) ((version) & 0x00FF)
66
67+#define UC_QML_DEPRECATION_WARNING(msg) \
68+ { \
69+ static bool loggedOnce = false; \
70+ if (!loggedOnce) { \
71+ if (QuickUtils::showDeprecationWarnings()) { \
72+ qmlInfo(this) << msg; \
73+ } \
74+ } \
75+ }
76+
77 class UCNamespace : public QObject
78 {
79 Q_OBJECT
80
81=== modified file 'src/Ubuntu/Components/plugin/ucubuntushape.cpp'
82--- src/Ubuntu/Components/plugin/ucubuntushape.cpp 2015-12-10 06:25:58 +0000
83+++ src/Ubuntu/Components/plugin/ucubuntushape.cpp 2015-12-14 16:05:47 +0000
84@@ -29,7 +29,7 @@
85 #include "ucubuntushapetexture.h"
86 #include "ucunits.h"
87 #include "ucnamespace.h"
88-#include "quickutils.h"
89+#include <QtCore/QPointer>
90 #include <QtGui/QGuiApplication>
91 #include <QtQml/QQmlInfo>
92 #include <QtQuick/private/qsgadaptationlayer_p.h>
93@@ -810,12 +810,9 @@
94 */
95 void UCUbuntuShape::setColor(const QColor& color)
96 {
97- static bool loggedOnce = false;
98- if (isVersionGreaterThanOrEqual(Version13) && !loggedOnce) {
99- loggedOnce = true;
100- qmlInfo(this) << "'color' is deprecated. Use 'backgroundColor', 'secondaryBackgroundColor' "
101- "and 'backgroundMode' instead.";
102- }
103+ Q_UNUSED(color);
104+ if (isVersionGreaterThanOrEqual(Version13))
105+ UC_QML_DEPRECATION_WARNING("'color' is deprecated. Use 'backgroundColor', 'secondaryBackgroundColor' and 'backgroundMode' instead.");
106
107 if (!(m_flags & BackgroundApiSet)) {
108 const QRgb colorRgb = qRgba(color.red(), color.green(), color.blue(), color.alpha());
109@@ -843,12 +840,8 @@
110 */
111 void UCUbuntuShape::setGradientColor(const QColor& gradientColor)
112 {
113- static bool loggedOnce = false;
114- if (isVersionGreaterThanOrEqual(Version13) && !loggedOnce) {
115- loggedOnce = true;
116- qmlInfo(this) << "'gradientColor' is deprecated. Use 'backgroundColor', "
117- "'secondaryBackgroundColor' and 'backgroundMode' instead.";
118- }
119+ if (isVersionGreaterThanOrEqual(Version13))
120+ UC_QML_DEPRECATION_WARNING("'gradientColor' is deprecated. Use 'backgroundColor', 'secondaryBackgroundColor' and 'backgroundMode' instead.");
121
122 if (!(m_flags & BackgroundApiSet)) {
123 m_flags |= GradientColorSet;
124@@ -874,11 +867,8 @@
125 */
126 void UCUbuntuShape::setImage(const QVariant& image)
127 {
128- static bool loggedOnce = false;
129- if (isVersionGreaterThanOrEqual(Version13) && !loggedOnce) {
130- loggedOnce = true;
131- qmlInfo(this) << "'image' is deprecated. Use 'source' instead.";
132- }
133+ if (isVersionGreaterThanOrEqual(Version13))
134+ UC_QML_DEPRECATION_WARNING("'image' is deprecated. Use 'source' instead.");
135
136 if (!(m_flags & SourceApiSet)) {
137 QQuickItem* newImage = qobject_cast<QQuickItem*>(qvariant_cast<QObject*>(image));
138
139=== modified file 'tests/unit/runtest.sh'
140--- tests/unit/runtest.sh 2015-12-10 11:44:26 +0000
141+++ tests/unit/runtest.sh 2015-12-14 16:05:47 +0000
142@@ -66,7 +66,7 @@
143
144 QML2_IMPORT_PATH=${_IMPORT_PATH} UBUNTU_UI_TOOLKIT_THEMES_PATH=${_THEMES_PATH} \
145 LD_LIBRARY_PATH=${_LIB_PATH} \
146- ALARM_BACKEND=memory SUPPRESS_DEPRECATED_NOTE=yes \
147+ ALARM_BACKEND=memory SUPPRESS_DEPRECATED_NOTE=no \
148 $_CMD $_ARGS 2>&1 | grep -v 'QFontDatabase: Cannot find font directory'
149 if [ "x$UITK_TEST_KEEP_RUNNING" != "x1" ]; then
150 ${BUILD_DIR}/tests/checkresults.sh $_XML

Subscribers

People subscribed via source and target branches