Warning, /pim/kube/dist/flatpak/kube.patch is written in an unsupported language. File is not indexed.
0001 diff --git a/framework/src/domain/eventoccurrencemodel.cpp b/framework/src/domain/eventoccurrencemodel.cpp 0002 index 222be8ff..e9fa3ccc 100644 0003 --- a/framework/src/domain/eventoccurrencemodel.cpp 0004 +++ b/framework/src/domain/eventoccurrencemodel.cpp 0005 @@ -69,12 +69,18 @@ int EventOccurrenceModel::length() const 0006 return mLength; 0007 } 0008 0009 -void EventOccurrenceModel::setCalendarFilter(const QSet<QByteArray> &calendarFilter) 0010 +void EventOccurrenceModel::setCalendarFilter(const QList<QByteArray> &calendarFilter) 0011 { 0012 - mCalendarFilter = calendarFilter; 0013 + qWarning() << "Setting the calendar filter to " << calendarFilter; 0014 + mCalendarFilter = calendarFilter.toSet(); 0015 updateQuery(); 0016 } 0017 0018 +QList<QByteArray> EventOccurrenceModel::calendarFilter() const 0019 +{ 0020 + return mCalendarFilter.toList(); 0021 +} 0022 + 0023 void EventOccurrenceModel::setFilter(const QVariantMap &filter) 0024 { 0025 mFilter = filter; 0026 diff --git a/framework/src/domain/eventoccurrencemodel.h b/framework/src/domain/eventoccurrencemodel.h 0027 index c97854f0..142f3931 100644 0028 --- a/framework/src/domain/eventoccurrencemodel.h 0029 +++ b/framework/src/domain/eventoccurrencemodel.h 0030 @@ -50,7 +50,7 @@ class KUBE_EXPORT EventOccurrenceModel : public QAbstractItemModel 0031 Q_OBJECT 0032 Q_PROPERTY(QDate start READ start WRITE setStart) 0033 Q_PROPERTY(int length READ length WRITE setLength) 0034 - Q_PROPERTY(QSet<QByteArray> calendarFilter WRITE setCalendarFilter) 0035 + Q_PROPERTY(QList<QByteArray> calendarFilter READ calendarFilter WRITE setCalendarFilter) 0036 Q_PROPERTY(QVariantMap filter WRITE setFilter) 0037 0038 public: 0039 @@ -83,7 +83,8 @@ public: 0040 QDate start() const; 0041 void setLength(int); 0042 int length() const; 0043 - void setCalendarFilter(const QSet<QByteArray> &); 0044 + void setCalendarFilter(const QList<QByteArray> &); 0045 + QList<QByteArray> calendarFilter() const; 0046 void setFilter(const QVariantMap &); 0047 0048 struct Occurrence { 0049 diff --git a/views/calendar/qml/MultiDayView.qml b/views/calendar/qml/MultiDayView.qml 0050 index 91c25939..ec1cea4d 100644 0051 --- a/views/calendar/qml/MultiDayView.qml 0052 +++ b/views/calendar/qml/MultiDayView.qml 0053 @@ -39,6 +39,9 @@ Item { 0054 property alias dayHeaderDelegate: dayLabels.delegate 0055 property Component weekHeaderDelegate 0056 property int month 0057 + onCalendarFilterChanged: { 0058 + console.warn("Calendar filter ", calendarFilter) 0059 + } 0060 0061 //Internal 0062 property int numberOfLinesShown: 0 0063 @@ -67,6 +70,7 @@ Item { 0064 model: Kube.EventOccurrenceModel { 0065 start: root.startDate 0066 length: root.daysToShow 0067 + //FIXME Unable to assign QJSValue to QSet<QByteArray>: Use QVariantList, or QVector<QString> 0068 calendarFilter: root.calendarFilter 0069 filter: root.filter ? root.filter : {} 0070 } 0071 diff --git a/views/calendar/tests/tst_calendar.qml b/views/calendar/tests/tst_calendar.qml 0072 index 02357fcd..f60526e9 100644 0073 --- a/views/calendar/tests/tst_calendar.qml 0074 +++ b/views/calendar/tests/tst_calendar.qml 0075 @@ -32,4 +32,80 @@ ViewTestCase { 0076 function test_start() { 0077 verify(view) 0078 } 0079 + 0080 + 0081 + 0082 + function test_3selectMessage() { 0083 + var initialState = { 0084 + accounts: [ 0085 + { 0086 + id: "account1", 0087 + name: "Test Account" 0088 + }, 0089 + ], 0090 + identities: [{ 0091 + account: "account1", 0092 + name: "Test Identity", 0093 + address: "identity@example.org" 0094 + }], 0095 + resources: [ 0096 + { 0097 + id: "caldavresource", 0098 + account: "account1", 0099 + type: "caldav", 0100 + } 0101 + ], 0102 + calendars: [{ 0103 + id: "calendar1", 0104 + resource: "caldavresource", 0105 + name: "Test Calendar", 0106 + color: "#af1a6a", 0107 + events: [ 0108 + { 0109 + resource: "caldavresource", 0110 + summary: "Event1", 0111 + starts: "2018-04-09T14:03:00", 0112 + organizer: "organizer@example.org", 0113 + attendees: [{email: "attendee1@example.org"}, {email: "identity@example.org"}] 0114 + }, 0115 + // Day-long events 0116 + { 0117 + resource: "caldavresource", 0118 + summary: "Test day-long event1", 0119 + description: "This is test day-long event #1", 0120 + starts: "2018-04-10T00:00:00", 0121 + ends: "2018-04-14T00:00:00", 0122 + allDay: true, 0123 + }, 0124 + ], 0125 + }, 0126 + { 0127 + id: "calendar16", 0128 + resource: "caldavresource", 0129 + name: "Test Calendar16", 0130 + color: "#f67400" 0131 + }], 0132 + } 0133 + TestStore.setup(initialState) 0134 + // var mailView = createTemporaryObject(mailViewComponent, testCase, {}) 0135 + // var folderListView = findChild(mailView, "folderListView"); 0136 + // verify(folderListView) 0137 + 0138 + // var folder = TestStore.load("folder", {resource: "resource1"}) 0139 + // verify(folder) 0140 + 0141 + // Kube.Fabric.postMessage(Kube.Messages.folderSelection, {"folder": folder, "trash": false}); 0142 + 0143 + // var mailListView = findChild(mailView, "mailListView"); 0144 + // verify(mailListView) 0145 + // var listView = findChild(mailListView, "listView"); 0146 + // verify(listView) 0147 + // tryCompare(listView, "count", 2) 0148 + 0149 + // var conversationView = findChild(mailView, "mailView"); 0150 + // verify(conversationView) 0151 + // var listView = findChild(conversationView, "listView"); 0152 + // verify(listView) 0153 + } 0154 + 0155 }