New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[nemo-qml-plugin-calendar] Add a search model. #45
Conversation
|
I've added a filter on calendar visibility in the worker thread to send to the manager only visible events. |
|
I've also added a loading attribute to the EventListModel, so one can display a busy indicator while the model is searching. |
|
I've added a commit adding a |
|
Rebased on latest master changes. |
src/calendarworker.cpp
Outdated
| @@ -752,6 +752,39 @@ CalendarData::Event CalendarWorker::createEventStruct(const KCalendarCore::Event | |||
| return event; | |||
| } | |||
|
|
|||
| void CalendarWorker::search(const QString &pattern, int limit) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The word pattern repeating on the API gives me a bit of association with regexps and other systems with wildcards and such, while here it's just a plain search string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I rename the property to searchString and change it everywhere accordingly.
|
I've removed the WIP notice. There may be some modification still to properly handle next occurrence of recurring events, but it can be done in a later PR. |
Add a search function to CalendarManager. It is based on ExtendedStorage::search() method. The worker is loading all matching incidences and retrieving the corresponding instance identifiers. The later are passed back to the manager via a new searchResults signal. While the former are sent back viw the existing dataLoaded signal. Also add a model listing occurrence of a search query. This model is based on a EventListModel where the identifiers are given as the result of a search call.
Add a search function to CalendarManager. It is based on ExtendedStorage::search() method. The worker is loading all matching incidences and retrieving the corresponding instance identifiers. The later are
passed back to the manager via a new searchResults signal. While the former are sent back viw the
existing dataLoaded signal.
Also add a model listing occurrence of a search
query. This model is based on a EventListModel
where the identifiers are given as the result of
a search call.
@pvuorela, this is based on sailfishos/mkcal#49 and aims at providing a list model for search results. It is conveniently based on evntlistmodel, since such model already provide event listing from instance identifiers. I still keep this as WIP since I would like to add a loading property to the eventlistmodel. But having it public already should help to see how the mkcal PR is working in reality.