142 |
142 |
143 /** |
143 /** |
144 * Starts removing events and all their duplicates. Clearing |
144 * Starts removing events and all their duplicates. Clearing |
145 * can be sync or async. In case of async, completion is |
145 * can be sync or async. In case of async, completion is |
146 * indicated by clearingCompleted signal. |
146 * indicated by clearingCompleted signal. |
147 * @param eventIds, ids of the events to be removed |
147 * @param events, events to be removed, events are removed only from |
|
148 * database, passed event objects themselves are not touched. |
148 * @return true if async clearing started |
149 * @return true if async clearing started |
149 */ |
150 */ |
150 bool clearEvents(const QList<int>& eventIds); |
151 bool clearEvents(const QList<LogsEvent*>& events); |
151 |
152 |
152 /** |
153 /** |
153 * Mark events as seen. Completion is indicated by |
154 * Mark events as seen. Completion is indicated by |
154 * markingCompleted signal. |
155 * markingCompleted signal. |
155 * @param eventIds, ids of the events to be marked |
156 * @param events, events to be marked |
156 * @return true if marking started |
157 * @return true if marking started |
157 */ |
158 */ |
158 bool markEventsSeen(const QList<int>& eventIds); |
159 bool markEventsSeen(const QList<LogsEvent*>& events); |
159 |
160 |
160 /** |
161 /** |
161 * Clear missed calls counter. |
162 * Clear missed calls counter. |
162 * @return 0 if clearing was success |
163 * @return 0 if clearing was success |
163 */ |
164 */ |
200 int setPredictiveSearch(bool enabled); |
201 int setPredictiveSearch(bool enabled); |
201 |
202 |
202 |
203 |
203 protected: // From LogsReaderObserver |
204 protected: // From LogsReaderObserver |
204 |
205 |
205 virtual void readCompleted(int readCount); |
206 virtual void readCompleted(); |
206 virtual void errorOccurred(int err); |
207 virtual void errorOccurred(int err); |
207 virtual void temporaryErrorOccurred(int err); |
208 virtual void temporaryErrorOccurred(int err); |
208 virtual void eventModifyingCompleted(); |
209 virtual void eventModifyingCompleted(); |
209 virtual void duplicatesReadingCompleted(QList<LogsEvent*> duplicates); |
210 virtual void duplicatesReadingCompleted(QList<LogsEvent*> duplicates); |
210 |
211 |
213 virtual void logsRemoveErrorOccured(int err); |
214 virtual void logsRemoveErrorOccured(int err); |
214 |
215 |
215 private: |
216 private: |
216 void initL(); |
217 void initL(); |
217 void handleTemporaryError(int& error); |
218 void handleTemporaryError(int& error); |
218 void deleteRemoved(int newEventCount); |
219 void deleteInvalidEvents(int newEventCount); |
219 int doMarkEventSeen(); |
220 int doMarkEventSeen(); |
220 bool handleModifyingCompletion(int err=0); |
221 bool handleModifyingCompletion(int err=0); |
|
222 void getTelNumMatchLenL(int& matchLen); |
221 |
223 |
222 private: // data |
224 private: // data |
223 |
225 |
224 QList<LogsEvent*>& mModelEvents; |
226 QList<LogsEvent*>& mModelEvents; |
225 bool mCheckAllEvents; |
227 bool mCheckAllEvents; |
235 QList<LogsEvent*> mEvents; |
237 QList<LogsEvent*> mEvents; |
236 QList<LogsEvent*> mDuplicatedEvents; |
238 QList<LogsEvent*> mDuplicatedEvents; |
237 QList<int> mRemovedEventIndexes; |
239 QList<int> mRemovedEventIndexes; |
238 QList<int> mUpdatedEventIndexes; |
240 QList<int> mUpdatedEventIndexes; |
239 QList<int> mAddedEventIndexes; |
241 QList<int> mAddedEventIndexes; |
240 QList<int> mEventsSeen; |
242 QList<LogsEvent> mEventsSeen; |
241 |
243 |
242 private: // Testing related friend definitions |
244 private: // Testing related friend definitions |
243 |
245 |
244 friend class UT_LogsDbConnector; |
246 friend class UT_LogsDbConnector; |
245 friend class UT_LogsRemove; |
247 friend class UT_LogsRemove; |