Code review comment for lp://qastaging/~pkunal-parmar/ubuntu-calendar-app/CalManagement

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Just a opinion here:
53 + onTriggered: {
54 + var collectionIds = [];
55 + var collections = calendarsList.model;
56 + for(var i=0; i < collections.length ; ++i) {
57 + var collection = collections[i]
58 + if(collection.extendedMetaData("collection-selected") === true) {
59 + collectionIds.push(collection.collectionId);
60 + }
61 + }
62 +
63 + var calFilter = Qt.createQmlObject("import QtOrganizer 5.0; CollectionFilter{}", root, "CalendarChoice.qml");
64 + calFilter.ids = collectionIds;
65 + model.filter = calFilter;
66 + pageStack.pop();
67 + }

This will be more QML "friendly" :D if you do something like:

53 + onTriggered: {
54 + var collectionIds = []
55 + var collections = calendarsList.model;
56 + for(var i=0; i < collections.length ; ++i) {
57 + var collection = collections[i]
58 + if(collection.extendedMetaData("collection-selected") === true) {
59 + collectionIds.push(collection.collectionId);
60 + }
61 + }
65 + model.filter.ids = collectionIds;
66 + pageStack.pop();
67 + }

Should not be necessary to recreate the filter every time, you can use the old filter instead.

« Back to merge proposal