Skip to content
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

Merged
merged 4 commits into from Jan 25, 2023
Merged

Update plugin #42

merged 4 commits into from Jan 25, 2023

Conversation

beroset
Copy link
Contributor

@beroset beroset commented Jan 23, 2023

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.

Signed-off-by: Ed Beroset <beroset@ieee.org>
Copy link
Contributor

@dcaliste dcaliste left a 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.

src/calendarevent.cpp Outdated Show resolved Hide resolved
src/calendarimportmodel.cpp Outdated Show resolved Hide resolved
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>
Copy link
Contributor

@dcaliste dcaliste left a 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.

src/calendarmanager.cpp Show resolved Hide resolved
src/calendarworker.cpp Outdated Show resolved Hide resolved
src/calendarevent.cpp Outdated Show resolved Hide resolved
tests/tst_calendarevent/tst_calendarevent.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@dcaliste dcaliste left a 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.

src/calendarmanager.cpp Outdated Show resolved Hide resolved
@dcaliste
Copy link
Contributor

Thanks for the update, looks good to me. I'll run the tests tomorrow to be sure.

Copy link
Contributor

@dcaliste dcaliste left a 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

src/calendarmanager.cpp Outdated Show resolved Hide resolved
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>
@pvuorela
Copy link
Contributor

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.

@dcaliste
Copy link
Contributor

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.

Copy link
Contributor

@pvuorela pvuorela left a 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!

@pvuorela pvuorela merged commit 7b37d58 into sailfishos:master Jan 25, 2023
@beroset beroset deleted the update-plugin branch January 25, 2023 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants