on xenial help sign in
Fix some warnings in Mock Notifications
72dac69Albert Astals Cid
tests/mocks/Unity/Notifications/MockActionModel.cpp+1−1
@@ -30,7 +30,7 @@ ActionModel::ActionModel(QObject *parent) : QStringListModel(parent), p(new Acti
30ActionModel::~ActionModel() {
30ActionModel::~ActionModel() {
31}
31}
32
32
33−int ActionModel::rowCount(const QModelIndex &index) const {
33+int ActionModel::rowCount(const QModelIndex &) const {
34 return p->labels.size();
34 return p->labels.size();
35}
35}
36
36
tests/mocks/Unity/Notifications/MockNotification.cpp+4
@@ -140,6 +140,10 @@ ActionModel* MockNotification::getActions() const {
140 return p->actionsModel;
140 return p->actionsModel;
141}
141}
142
142
143+QStringList MockNotification::rawActions() const {
144+ return p->actions;
145+}
146+
143void MockNotification::setActions(const QStringList &actions) {
147void MockNotification::setActions(const QStringList &actions) {
144 if(p->actions != actions) {
148 if(p->actions != actions) {
145 p->actions = actions;
149 p->actions = actions;
tests/mocks/Unity/Notifications/MockNotification.h+2−1
@@ -38,7 +38,7 @@ class MockNotification : public QObject {
38 Q_PROPERTY(QString icon READ getIcon WRITE setIcon NOTIFY iconChanged)
38 Q_PROPERTY(QString icon READ getIcon WRITE setIcon NOTIFY iconChanged)
39 Q_PROPERTY(QString secondaryIcon READ getSecondaryIcon WRITE setSecondaryIcon NOTIFY secondaryIconChanged)
39 Q_PROPERTY(QString secondaryIcon READ getSecondaryIcon WRITE setSecondaryIcon NOTIFY secondaryIconChanged)
40 Q_PROPERTY(Type type READ getType WRITE setType NOTIFY typeChanged)
40 Q_PROPERTY(Type type READ getType WRITE setType NOTIFY typeChanged)
41− Q_PROPERTY(QStringList rawActions WRITE setActions)
41+ Q_PROPERTY(QStringList rawActions READ rawActions WRITE setActions)
42 Q_PROPERTY(ActionModel* actions READ getActions NOTIFY actionsChanged)
42 Q_PROPERTY(ActionModel* actions READ getActions NOTIFY actionsChanged)
43 Q_PROPERTY(QVariantMap hints READ getHints WRITE setHints NOTIFY hintsChanged)
43 Q_PROPERTY(QVariantMap hints READ getHints WRITE setHints NOTIFY hintsChanged)
44
44
@@ -83,6 +83,7 @@ public:
83 Type getType() const;
83 Type getType() const;
84 void setType(Type type);
84 void setType(Type type);
85 ActionModel* getActions() const;
85 ActionModel* getActions() const;
86+ QStringList rawActions() const;
86 void setActions(const QStringList &actions);
87 void setActions(const QStringList &actions);
87 QVariantMap getHints() const;
88 QVariantMap getHints() const;
88 void setHints(const QVariantMap& hints);
89 void setHints(const QVariantMap& hints);
tests/mocks/Unity/Notifications/MockNotificationModel.cpp+1−1
@@ -37,7 +37,7 @@ MockNotificationModel::MockNotificationModel(QObject *parent) : QAbstractListMod
37MockNotificationModel::~MockNotificationModel() {
37MockNotificationModel::~MockNotificationModel() {
38}
38}
39
39
40−int MockNotificationModel::rowCount(const QModelIndex &parent) const {
40+int MockNotificationModel::rowCount(const QModelIndex &) const {
41 return m_queue.size();
41 return m_queue.size();
42}
42}
43
43