Merge lp:~mihirsoni/ubuntu-calendar-app/limitLablesModel into lp:ubuntu-calendar-app

Proposed by Mihir Soni
Status: Merged
Approved by: Kunal Parmar
Approved revision: 522
Merged at revision: 521
Proposed branch: lp:~mihirsoni/ubuntu-calendar-app/limitLablesModel
Merge into: lp:ubuntu-calendar-app
Diff against target: 72 lines (+16/-12)
3 files modified
Defines.js (+1/-6)
EventRepetition.qml (+5/-1)
LimitLabelModel.qml (+10/-5)
To merge this branch: bzr merge lp:~mihirsoni/ubuntu-calendar-app/limitLablesModel
Reviewer Review Type Date Requested Status
Kunal Parmar Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Arto Jalkanen (community) Approve
Review via email: mp+239194@code.launchpad.net

Commit message

Moved limitLabels from object to ListModel

Description of the change

Moved limitLabels from object to ListModel

To post a comment you must log in.
Revision history for this message
Arto Jalkanen (ajalkane) wrote :

Looks good, so I'm just going to nitpick: the function() definition is intended too deep.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Arto Jalkanen (ajalkane) wrote :

So yeah, I'll approve and you'll consider whether to change the indentation.

review: Approve
521. By Mihir Soni

Indentation issues

522. By Mihir Soni

reverted pot changes

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

seems good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Defines.js'
2--- Defines.js 2014-09-20 10:45:35 +0000
3+++ Defines.js 2014-10-22 17:38:27 +0000
4@@ -20,7 +20,6 @@
5 .import QtOrganizer 5.0 as QtPim
6
7 var recurrenceLabel = getRecurrenceLabels();
8-var limitLabel = getLimitLabels();
9 var weekLabel = getWeekLabels();
10 // It contains multiple weekly entries to handle following occurence
11 //1.Every Weekday (Monday to Friday
12@@ -41,11 +40,7 @@
13 var object = component.createObject(Qt.application);
14 return object.recurrenceLabel;
15 }
16-function getLimitLabels(){
17- var component = Qt.createComponent(Qt.resolvedUrl("LimitLabelDefines.qml"));
18- var object = component.createObject(Qt.application);
19- return object.limitLabel;
20-}
21+
22 function getWeekLabels(){
23 var object = Qt.createQmlObject('\
24 import QtQuick 2.3;\
25
26=== modified file 'EventRepetition.qml'
27--- EventRepetition.qml 2014-10-17 05:42:34 +0000
28+++ EventRepetition.qml 2014-10-22 17:38:27 +0000
29@@ -44,6 +44,10 @@
30 id:eventUtils
31 }
32
33+ LimitLabelModel {
34+ id:limitLabels
35+ }
36+
37 Component.onCompleted: {
38 //Fill Date & limitcount if any
39 var index = 0;
40@@ -203,7 +207,7 @@
41 margins: units.gu(2)
42 }
43
44- model: Defines.limitLabel
45+ model: limitLabels
46 containerHeight: itemHeight * 4
47 onExpandedChanged: Qt.inputMethod.hide()
48 }
49
50=== renamed file 'LimitLabelDefines.qml' => 'LimitLabelModel.qml'
51--- LimitLabelDefines.qml 2014-09-20 10:45:35 +0000
52+++ LimitLabelModel.qml 2014-10-22 17:38:27 +0000
53@@ -16,9 +16,14 @@
54 * along with this program. If not, see <http://www.gnu.org/licenses/>.
55 */
56 import QtQuick 2.3;
57-import Ubuntu.Components 1.1;
58-QtObject {
59- property var limitLabel:[i18n.tr("Never"),i18n.tr("After X Occurrence"),
60- i18n.tr("After Date")];
61-
62+
63+ListModel {
64+ id:limitLables
65+ Component.onCompleted: initialise()
66+
67+ function initialise() {
68+ limitLables.append({ "label": i18n.tr("Never") })
69+ limitLables.append({ "label": i18n.tr("After X Occurrence") })
70+ limitLables.append({ "label": i18n.tr("After Date") })
71+ }
72 }

Subscribers

People subscribed via source and target branches

to status/vote changes: