Merge lp:~renatofilho/qtorganizer5-eds/fix-match-all into lp:~ubuntu-sdk-team/qtorganizer5-eds/trunk

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Zoltan Balogh
Approved revision: 17
Merged at revision: 17
Proposed branch: lp:~renatofilho/qtorganizer5-eds/fix-match-all
Merge into: lp:~ubuntu-sdk-team/qtorganizer5-eds/trunk
Diff against target: 111 lines (+10/-25)
4 files modified
qorganizer/qorganizer-eds-fetchrequestdata.cpp (+8/-6)
qorganizer/qorganizer-eds-fetchrequestdata.h (+1/-1)
qorganizer/qorganizer-eds-viewwatcher.cpp (+1/-16)
qorganizer/qorganizer-eds-viewwatcher.h (+0/-2)
To merge this branch: bzr merge lp:~renatofilho/qtorganizer5-eds/fix-match-all
Reviewer Review Type Date Requested Status
Nekhelesh Ramananthan (community) Approve
Olivier Tilloy (community) Approve
PS Jenkins bot continuous-integration Approve
Ubuntu SDK team Pending
Review via email: mp+191080@code.launchpad.net

Commit message

Used a proper match all query string.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

I haven’t actually verified that this fixes bug #1236390, however the code looks sound to me.

review: Approve
Revision history for this message
David Planella (dpm) wrote :

In order to make testing easier, there are now packages available containing this change in the core apps PPA:

https://code.launchpad.net/~ubuntu-touch-coreapps-drivers/+archive/daily/+packages?field.name_filter=organizer&field.status_filter=published&field.series_filter=saucy

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

This does not fix bug #1236390. I installed the PPA and installed the qtorganizer5-eds package and on running the clock app through the qtcreator, the alarms are not saved. Console output log can be found at http://paste.ubuntu.com/6240020/

I did also test the clock app installed on the phone (click app), and still didnnt notice any alarms being saved (Image 97).

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Okay so on testing the armhf deb package that I downloaded from this MP at http://jenkins.qa.ubuntu.com/job/qtorganizer5-eds-saucy-armhf-ci/13, alarms can now be saved properly :) .. Approving!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qorganizer/qorganizer-eds-fetchrequestdata.cpp'
2--- qorganizer/qorganizer-eds-fetchrequestdata.cpp 2013-10-05 22:39:01 +0000
3+++ qorganizer/qorganizer-eds-fetchrequestdata.cpp 2013-10-15 01:16:52 +0000
4@@ -59,14 +59,17 @@
5 // TODO: emit changeset???
6 }
7
8-void FetchRequestData::appendResults(QList<QOrganizerItem> results)
9+int FetchRequestData::appendResults(QList<QOrganizerItem> results)
10 {
11+ int count = 0;
12 QOrganizerItemFetchRequest *req = request<QOrganizerItemFetchRequest>();
13 Q_FOREACH(QOrganizerItem item, results) {
14 if (QOrganizerManagerEngine::testFilter(req->filter(), item)) {
15 m_results << item;
16+ count++;
17 }
18 }
19+ return count;
20 }
21
22 QString FetchRequestData::dateFilter()
23@@ -74,17 +77,16 @@
24 QDateTime startDate = request<QOrganizerItemFetchRequest>()->startDate();
25 QDateTime endDate = request<QOrganizerItemFetchRequest>()->endDate();
26
27- if (!startDate.isValid()) {
28- startDate.setMSecsSinceEpoch(0);
29+ if (!startDate.isValid() ||
30+ !endDate.isValid()) {
31+ return QStringLiteral("#t"); // match all
32 }
33
34- if (!endDate.isValid()) {
35- endDate.setMSecsSinceEpoch(std::numeric_limits<qint64>::max());
36- }
37
38 QString query = QString("(occur-in-time-range? "
39 "(make-time \"%1\") (make-time \"%2\"))")
40 .arg(isodate_from_time_t(startDate.toTime_t()))
41 .arg(isodate_from_time_t(endDate.toTime_t()));
42+
43 return query;
44 }
45
46=== modified file 'qorganizer/qorganizer-eds-fetchrequestdata.h'
47--- qorganizer/qorganizer-eds-fetchrequestdata.h 2013-08-14 21:23:01 +0000
48+++ qorganizer/qorganizer-eds-fetchrequestdata.h 2013-10-15 01:16:52 +0000
49@@ -31,7 +31,7 @@
50 QOrganizerEDSCollectionEngineId* collection() const;
51
52 void finish(QtOrganizer::QOrganizerManager::Error error = QtOrganizer::QOrganizerManager::NoError);
53- void appendResults(QList<QtOrganizer::QOrganizerItem> results);
54+ int appendResults(QList<QtOrganizer::QOrganizerItem> results);
55 QString dateFilter();
56
57 private:
58
59=== modified file 'qorganizer/qorganizer-eds-viewwatcher.cpp'
60--- qorganizer/qorganizer-eds-viewwatcher.cpp 2013-10-07 16:13:48 +0000
61+++ qorganizer/qorganizer-eds-viewwatcher.cpp 2013-10-15 01:16:52 +0000
62@@ -26,8 +26,6 @@
63
64 using namespace QtOrganizer;
65
66-QString ViewWatcher::m_dateFilter;
67-
68 ViewWatcher::ViewWatcher(QOrganizerEDSEngine *engine,
69 const QOrganizerCollectionId &collectionId,
70 QOrganizerEDSCollectionEngineId *edsId)
71@@ -37,19 +35,6 @@
72 m_eView(0),
73 m_eventLoop(0)
74 {
75- if (m_dateFilter.isEmpty()) {
76- QDateTime startDate;
77- startDate.setMSecsSinceEpoch(0);
78-
79- QDateTime endDate;
80- endDate.setMSecsSinceEpoch(std::numeric_limits<qint64>::max());
81-
82- m_dateFilter = QString("(occur-in-time-range? "
83- "(make-time \"%1\") (make-time \"%2\"))")
84- .arg(isodate_from_time_t(startDate.toTime_t()))
85- .arg(isodate_from_time_t(endDate.toTime_t()));
86-
87- }
88 m_cancellable = g_cancellable_new();
89 e_cal_client_connect(m_edsId->m_esource,
90 m_edsId->m_sourceType,
91@@ -79,7 +64,7 @@
92 }
93 } else {
94 e_cal_client_get_view(self->m_eClient,
95- self->m_dateFilter.toUtf8().data(),
96+ QStringLiteral("#t").toUtf8().constData(), // match all,
97 self->m_cancellable,
98 (GAsyncReadyCallback) ViewWatcher::viewReady,
99 self);
100
101=== modified file 'qorganizer/qorganizer-eds-viewwatcher.h'
102--- qorganizer/qorganizer-eds-viewwatcher.h 2013-10-06 23:04:20 +0000
103+++ qorganizer/qorganizer-eds-viewwatcher.h 2013-10-15 01:16:52 +0000
104@@ -50,8 +50,6 @@
105 ECalClientView *m_eView;
106 QEventLoop *m_eventLoop;
107
108- static QString m_dateFilter;
109-
110 static void clientConnected(GObject *sourceObject, GAsyncResult *res, ViewWatcher *self);
111 static void viewReady(GObject *sourceObject, GAsyncResult *res, ViewWatcher *self);
112

Subscribers

People subscribed via source and target branches