Review Request 125817: Add plugin system for Calendar events

Daniel Vrátil dvratil at kde.org
Tue Oct 27 21:22:21 UTC 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125817/#review87549
-----------------------------------------------------------



src/declarativeimports/calendar/daysmodel.cpp (line 67)
<https://git.reviewboard.kde.org/r/125817/#comment60098>

    You can drop this now, QPluginLoader will destroy the object automatically when unloading the library.



src/declarativeimports/calendar/daysmodel.cpp (line 156)
<https://git.reviewboard.kde.org/r/125817/#comment60099>

    You can use `auto` instead of the super-long iterator type :)



src/declarativeimports/calendar/eventdatadecorator.h (line 38)
<https://git.reviewboard.kde.org/r/125817/#comment60108>

    Don't you need to export the enum as Q_ENUM to access it from QML? In that case you probably need your own enum in `EventDataDecorator` and map to it from `EventData::EventType`...



src/declarativeimports/calendar/plasmacalendarintegration/CMakeLists.txt (line 26)
<https://git.reviewboard.kde.org/r/125817/#comment60107>

    Wasn't generate_export_header introduced in CMake 3.0? In that case you need to bump the minimum version in root CMakeLists.txt



src/declarativeimports/calendar/plasmacalendarintegration/calendareventsplugin.h (line 31)
<https://git.reviewboard.kde.org/r/125817/#comment60100>

    You are missing implementation for this entire class



src/declarativeimports/calendar/plasmacalendarintegration/calendareventsplugin.h (line 42)
<https://git.reviewboard.kde.org/r/125817/#comment60101>

    Thinking about it, this won't work unless the dpointer is a QSharedDataPointer, because otherwise you can't tell how many copies out there are referencing EventData::Private, so you will either double-delete it or leak it. 
    
    Sorry for my misleading suggestion, naked dpointers only work if the class is Q_DISABLE_COPY.


- Daniel Vrátil


On Oct. 27, 2015, 10:10 p.m., Martin Klapetek wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125817/
> -----------------------------------------------------------
> 
> (Updated Oct. 27, 2015, 10:10 p.m.)
> 
> 
> Review request for Plasma and Daniel Vrátil.
> 
> 
> Repository: plasma-framework
> 
> 
> Description
> -------
> 
> This adds a simple plugin interface that can be subclassed
> and provide events integration with Plasma Calendar applet.
> 
> It's asynchronous and I've kept it deliberately simple.
> For now the Calendar tells the plugins which date range
> is being displayed, the plugins load the data and then
> emit the dataReady() signal containing the events.
> 
> The events are stored in a multihash for quick access
> by the Calendar's agenda part but also for overall
> easy-to-use (eg. in teh model data()).
> 
> The event data is stored in EventData class, which has
> a pretty self-explanatory members, except perhaps the
> "isMinor" one. The intention with this is to support
> namedays, where in some countries the calendars have
> different name every day. This is just a minor holiday
> and as such should not mark the calendar grid, otherwise
> the whole grid would be in a different color.
> 
> Putting the interface here might raise the question of
> depending on plasma-framework, but plugins provided by
> KDE can go to plasma-workspace and other 3rd party ones
> would just have to live with it. I don't think it will
> be a problem but if it turns out it is, we can rethink
> the placement.
> 
> 
> Diffs
> -----
> 
>   src/declarativeimports/calendar/CMakeLists.txt 40ead91 
>   src/declarativeimports/calendar/calendarplugin.cpp bafe80c 
>   src/declarativeimports/calendar/daysmodel.h a5bdac9 
>   src/declarativeimports/calendar/daysmodel.cpp 2d059a8 
>   src/declarativeimports/calendar/eventdatadecorator.h PRE-CREATION 
>   src/declarativeimports/calendar/eventdatadecorator.cpp PRE-CREATION 
>   src/declarativeimports/calendar/plasmacalendarintegration/CMakeLists.txt PRE-CREATION 
>   src/declarativeimports/calendar/plasmacalendarintegration/PlasmaCalendarIntegrationConfig.cmake.in PRE-CREATION 
>   src/declarativeimports/calendar/plasmacalendarintegration/calendareventsplugin.h PRE-CREATION 
>   src/declarativeimports/calendar/plasmacalendarintegration/calendareventsplugin.cpp PRE-CREATION 
> 
> Diff: https://git.reviewboard.kde.org/r/125817/diff/
> 
> 
> Testing
> -------
> 
> I have a simple KHolidays based plugin written (patch should be up later today)
> and patches in the Calendar applet.
> 
> Everything works as expected:
> * the days are marked as containing an event
> * the agenda part displays details of that event (name)
> 
> 
> Thanks,
> 
> Martin Klapetek
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20151027/8d8da062/attachment.html>


More information about the Plasma-devel mailing list