Merge lp:~zsombi/ubuntu-ui-toolkit/expose-alarmmodel-reset into lp:ubuntu-ui-toolkit/staging

Proposed by Zsombor Egri
Status: Merged
Approved by: Cris Dywan
Approved revision: 1306
Merged at revision: 1347
Proposed branch: lp:~zsombi/ubuntu-ui-toolkit/expose-alarmmodel-reset
Merge into: lp:ubuntu-ui-toolkit/staging
Prerequisite: lp:~zsombi/ubuntu-ui-toolkit/alarm-data-adaptation
Diff against target: 56 lines (+16/-1)
3 files modified
components.api (+1/-0)
modules/Ubuntu/Components/plugin/ucalarmmodel.cpp (+12/-1)
modules/Ubuntu/Components/plugin/ucalarmmodel.h (+3/-0)
To merge this branch: bzr merge lp:~zsombi/ubuntu-ui-toolkit/expose-alarmmodel-reset
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Cris Dywan Approve
Review via email: mp+238802@code.launchpad.net

Commit message

Expose refresh() function in revision 1 (Ubuntu.Components 1.1)

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

prereq sync

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

modules/Ubuntu/Components/plugin/ucalarmmodel.cpp:233: warning: Unrecognizable QML module/component qualifier for refresh()

It should be \qmlmethod void AlarmModel::refresh()

review: Needs Fixing
1304. By Zsombor Egri

prereq sync

1305. By Zsombor Egri

prereq sync

1306. By Zsombor Egri

prereq sync

Revision history for this message
Cris Dywan (kalikiana) wrote :

Nice! (Although I don't "like" the change… it's good for what it does ;-))

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) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'components.api'
2--- components.api 2014-11-18 13:32:37 +0000
3+++ components.api 2014-11-20 13:44:49 +0000
4@@ -834,6 +834,7 @@
5 prototype: "QAbstractListModel"
6 exports: ["AlarmModel 0.1", "AlarmModel 1.0"]
7 Property { name: "count"; type: "int"; isReadonly: true }
8+ Method { name: "refresh"; revision: 1 }
9 Method {
10 name: "get"
11 Parameter { name: "index"; type: "int" }
12
13=== modified file 'modules/Ubuntu/Components/plugin/ucalarmmodel.cpp'
14--- modules/Ubuntu/Components/plugin/ucalarmmodel.cpp 2014-11-20 13:44:48 +0000
15+++ modules/Ubuntu/Components/plugin/ucalarmmodel.cpp 2014-11-20 13:44:49 +0000
16@@ -151,7 +151,7 @@
17 void UCAlarmModel::componentComplete()
18 {
19 // fetch alarms
20- AlarmManager::instance().fetchAlarms();
21+ refresh();
22 }
23
24 int UCAlarmModel::rowCount(const QModelIndex &parent) const
25@@ -225,6 +225,17 @@
26 }
27
28 /*!
29+ * \qmlmethod AlarmModel::refresh()
30+ * The function refreshes the model by invalidating the alarm cache. Use this
31+ * function only if the refresh is absolutely required, otherwise it will cause
32+ * performance problems.
33+ */
34+void UCAlarmModel::refresh()
35+{
36+ AlarmManager::instance().fetchAlarms();
37+}
38+
39+/*!
40 * \internal
41 * The slot prepares the model reset.
42 */
43
44=== modified file 'modules/Ubuntu/Components/plugin/ucalarmmodel.h'
45--- modules/Ubuntu/Components/plugin/ucalarmmodel.h 2014-11-20 13:44:48 +0000
46+++ modules/Ubuntu/Components/plugin/ucalarmmodel.h 2014-11-20 13:44:49 +0000
47@@ -50,6 +50,9 @@
48 Q_SIGNALS:
49 void countChanged();
50
51+public Q_SLOTS:
52+ Q_REVISION(1) void refresh();
53+
54 private Q_SLOTS:
55 void refreshStart();
56 void refreshEnd();

Subscribers

People subscribed via source and target branches