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

Proposed by Cris Dywan
Status: Merged
Approved by: Zoltan Balogh
Approved revision: 1505
Merged at revision: 1510
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/cutDownDepWarn
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 45 lines (+7/-0)
2 files modified
modules/Ubuntu/Components/plugin/ucdeprecatedtheme.cpp (+5/-0)
modules/Ubuntu/Components/plugin/ucdeprecatedtheme.h (+2/-0)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/cutDownDepWarn
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Zsombor Egri Approve
Review via email: mp+259350@code.launchpad.net

Commit message

Only print unique deprecation notes

To post a comment you must log in.
Revision history for this message
Zsombor Egri (zsombi) wrote :

Perhaps we should move this showDeprecationNote to ucnamespace and use it widely for all deprecation notes. Then we can turn them on/off everywhere. Perhaps a separate MR to do that.

Revision history for this message
Zsombor Egri (zsombi) :
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)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/plugin/ucdeprecatedtheme.cpp'
2--- modules/Ubuntu/Components/plugin/ucdeprecatedtheme.cpp 2015-05-04 11:20:26 +0000
3+++ modules/Ubuntu/Components/plugin/ucdeprecatedtheme.cpp 2015-05-18 05:50:31 +0000
4@@ -65,6 +65,7 @@
5 UCDeprecatedTheme::UCDeprecatedTheme(QObject *parent)
6 : QObject(parent)
7 {
8+ m_notes = QHash<QString, bool>();
9 connect(&UCTheme::defaultTheme(), &UCTheme::nameChanged,
10 this, &UCDeprecatedTheme::nameChanged);
11 connect(&UCTheme::defaultTheme(), &UCTheme::paletteChanged,
12@@ -73,9 +74,13 @@
13
14 void UCDeprecatedTheme::showDeprecatedNote(QObject *onItem, const char *note)
15 {
16+ QString noteId(QString("%1.%2").arg(note).arg(onItem->metaObject()->className()));
17+ if (m_notes.contains(noteId))
18+ return;
19 QByteArray suppressNote = qgetenv("SUPPRESS_DEPRECATED_NOTE");
20 if (suppressNote.isEmpty() || suppressNote != "yes") {
21 qmlInfo(onItem) << note;
22+ m_notes.insert(noteId, true);
23 }
24 }
25
26
27=== modified file 'modules/Ubuntu/Components/plugin/ucdeprecatedtheme.h'
28--- modules/Ubuntu/Components/plugin/ucdeprecatedtheme.h 2015-04-24 14:07:02 +0000
29+++ modules/Ubuntu/Components/plugin/ucdeprecatedtheme.h 2015-05-18 05:50:31 +0000
30@@ -20,6 +20,7 @@
31 #define UCDEPRECATEDTHEME_H
32
33 #include <QtCore/QObject>
34+#include <QtCore/QHash>
35
36 class QQmlComponent;
37 class QQmlContext;
38@@ -51,6 +52,7 @@
39
40 private:
41 void showDeprecatedNote(QObject *onItem, const char *note);
42+ QHash<QString, bool> m_notes;
43 };
44
45 #endif // UCDEPRECATEDTHEME_H

Subscribers

People subscribed via source and target branches