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
=== modified file 'src/Ubuntu/Components/plugin/ucubuntushape.cpp'
--- src/Ubuntu/Components/plugin/ucubuntushape.cpp 2015-08-06 13:16:24 +0000
+++ src/Ubuntu/Components/plugin/ucubuntushape.cpp 2015-08-07 17:41:55 +0000
@@ -793,8 +793,12 @@
793*/793*/
794void UCUbuntuShape::setColor(const QColor& color)794void UCUbuntuShape::setColor(const QColor& color)
795{795{
796 qmlInfo(this) << "'color' is deprecated. Use 'backgroundColor', 'secondaryBackgroundColor' and "796 static bool deprecationNoteShown = false;
797 "'backgroundMode' instead.";797 if (!deprecationNoteShown) {
798 deprecationNoteShown = true;
799 qmlInfo(this) << "'color' is deprecated. Use 'backgroundColor', 'secondaryBackgroundColor' and "
800 "'backgroundMode' instead.";
801 }
798802
799 if (!(m_flags & BackgroundApiSet)) {803 if (!(m_flags & BackgroundApiSet)) {
800 const QRgb colorRgb = qRgba(color.red(), color.green(), color.blue(), color.alpha());804 const QRgb colorRgb = qRgba(color.red(), color.green(), color.blue(), color.alpha());
@@ -822,8 +826,12 @@
822*/826*/
823void UCUbuntuShape::setGradientColor(const QColor& gradientColor)827void UCUbuntuShape::setGradientColor(const QColor& gradientColor)
824{828{
825 qmlInfo(this) << "'gradientColor' is deprecated. Use 'backgroundColor', "829 static bool deprecationNoteShown = false;
826 "'secondaryBackgroundColor' and 'backgroundMode' instead.";830 if (!deprecationNoteShown) {
831 deprecationNoteShown = true;
832 qmlInfo(this) << "'gradientColor' is deprecated. Use 'backgroundColor', "
833 "'secondaryBackgroundColor' and 'backgroundMode' instead.";
834 }
827835
828 if (!(m_flags & BackgroundApiSet)) {836 if (!(m_flags & BackgroundApiSet)) {
829 m_flags |= GradientColorSet;837 m_flags |= GradientColorSet;
@@ -849,7 +857,11 @@
849*/857*/
850void UCUbuntuShape::setImage(const QVariant& image)858void UCUbuntuShape::setImage(const QVariant& image)
851{859{
852 qmlInfo(this) << "'image' is deprecated. Use 'source' instead.";860 static bool deprecationNoteShown = false;
861 if (!deprecationNoteShown) {
862 deprecationNoteShown = true;
863 qmlInfo(this) << "'image' is deprecated. Use 'source' instead.";
864 }
853865
854 if (!(m_flags & SourceApiSet)) {866 if (!(m_flags & SourceApiSet)) {
855 QQuickItem* newImage = qobject_cast<QQuickItem*>(qvariant_cast<QObject*>(image));867 QQuickItem* newImage = qobject_cast<QQuickItem*>(qvariant_cast<QObject*>(image));
@@ -878,7 +890,11 @@
878// maintain it for a while for compatibility reasons.890// maintain it for a while for compatibility reasons.
879void UCUbuntuShape::setStretched(bool stretched)891void UCUbuntuShape::setStretched(bool stretched)
880{892{
881 qmlInfo(this) << "'stretched' is deprecated. Use 'sourceFillMode' instead";893 static bool deprecationNoteShown = false;
894 if (!deprecationNoteShown) {
895 deprecationNoteShown = true;
896 qmlInfo(this) << "'stretched' is deprecated. Use 'sourceFillMode' instead";
897 }
882898
883 if (!(m_flags & SourceApiSet)) {899 if (!(m_flags & SourceApiSet)) {
884 if (!!(m_flags & Stretched) != stretched) {900 if (!!(m_flags & Stretched) != stretched) {
@@ -897,7 +913,11 @@
897// Deprecation layer. Same comment as setStretched().913// Deprecation layer. Same comment as setStretched().
898void UCUbuntuShape::setHorizontalAlignment(HAlignment horizontalAlignment)914void UCUbuntuShape::setHorizontalAlignment(HAlignment horizontalAlignment)
899{915{
900 qmlInfo(this) << "'horizontalAlignment' is deprecated. Use 'sourceHorizontalAlignment' instead";916 static bool deprecationNoteShown = false;
917 if (!deprecationNoteShown) {
918 deprecationNoteShown = true;
919 qmlInfo(this) << "'horizontalAlignment' is deprecated. Use 'sourceHorizontalAlignment' instead";
920 }
901921
902 if (!(m_flags & SourceApiSet)) {922 if (!(m_flags & SourceApiSet)) {
903 if (m_imageHorizontalAlignment != horizontalAlignment) {923 if (m_imageHorizontalAlignment != horizontalAlignment) {
@@ -912,7 +932,11 @@
912// Deprecation layer. Same comment as setStretched().932// Deprecation layer. Same comment as setStretched().
913void UCUbuntuShape::setVerticalAlignment(VAlignment verticalAlignment)933void UCUbuntuShape::setVerticalAlignment(VAlignment verticalAlignment)
914{934{
915 qmlInfo(this) << "'horizontalAlignment' is deprecated. Use 'sourceVerticalAlignment' instead";935 static bool deprecationNoteShown = false;
936 if (!deprecationNoteShown) {
937 deprecationNoteShown = true;
938 qmlInfo(this) << "'horizontalAlignment' is deprecated. Use 'sourceVerticalAlignment' instead";
939 }
916940
917 if (!(m_flags & SourceApiSet)) {941 if (!(m_flags & SourceApiSet)) {
918 if (m_imageVerticalAlignment != verticalAlignment) {942 if (m_imageVerticalAlignment != verticalAlignment) {

Subscribers

People subscribed via source and target branches