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
Update plugin #42
Update plugin #42
Conversation
Signed-off-by: Ed Beroset <beroset@ieee.org>
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.
Thanks for the changes and modernising the base code. If you needed to add some compilation flags to get the compilation warnings, you may also add them in the rpm/nemo-qml-plugin-calendar-qt5.spec or in the {src,tests}.pro files depending.
The code in CalendarWorker::loadData() was iterating over copies of pointers, rather than the pointers in the container. This fixes that bug. Signed-off-by: Ed Beroset <beroset@ieee.org>
The previous code had this line for iteration:
for (const KCalendarCore::Incidence::Ptr &incidence : mEventList) {
The gcc compiler rightly complains that the loop variable 'incidence' of type 'const Ptr&'
{aka 'const QSharedPointer<KCalendarCore::Incidence>&'} binds to a temporary constructed from
type 'const QSharedPointer<KCalendarCore::Event>'
This version fixes that problem:
for (const KCalendarCore::Event::Ptr& incidence : mEventList) {
Signed-off-by: Ed Beroset <beroset@ieee.org>
c7576fa
to
9039291
Compare
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.
Thanks for the update. Regarding the actual changes, I've got some remarks.
9039291
to
2b2d7ea
Compare
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.
Thanks for the work, it looks nice to me, besides a minor comment. Already approving.
2b2d7ea
to
5ce5036
Compare
|
Thanks for the update, looks good to me. I'll run the tests tomorrow to be sure. |
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.
After this, it is compiling for Sailfish. Tests for the calendar manager and the import model are ok. Tests for the agenda model is failing and also the one for calendarevent, but this may not be related to this PR. I'll check
The QDateTime(const QDate&) constructor is deprecated, so this uses QDateTime(QDate.startOfDay()) or QDateTime(QDate.endOfDay()) as appropriate. This also simplified one place in calendarworker.cpp in CalendarWorker::eventOccurrences(). In that, an elaborate dance to get the last second of the second date was replaced by simply using QDate.endOfDay(). In all cases this is done with a QT_VERSION_CHECK(5, 14, 0) so compiling with earlier versions of QT will still work. Signed-off-by: Ed Beroset <beroset@ieee.org>
5ce5036
to
64e130b
Compare
|
Running the tests myself they pass fine. The Qt <5.14 changes don't either seem too big. Would be fine for me already, but waiting a moment if @dcaliste still had some comments. |
|
Thanks @pvuorela for testing also. I guess the failing ones come from my setup (I'll investigate later, since it's not related to the changes here). It's all good to me. |
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.
Alright, let's get this in. Thanks for the PR!
In working with this plugin on AsteroidOS, I found that I had to make some changes to allow it to compile and run cleanly with gcc 11.