[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: Review Request 125817: Add plugin system for Calendar events
From:       "Martin Klapetek" <martin.klapetek () gmail ! com>
Date:       2015-10-31 5:11:30
Message-ID: 20151031051130.14097.36286 () mimi ! kde ! org
[Download RAW message or body]

--===============3408604910798735441==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit



> On Oct. 31, 2015, 2:08 a.m., David Edmundson wrote:
> > src/declarativeimports/calendar/daysmodel.h, line 44
> > <https://git.reviewboard.kde.org/r/125817/diff/4/?file=413167#file413167line44>
> > 
> > I think we need some sort of
> > 
> > QStringList availablePlugins()
> > 
> > setPlugins( QStringList plugins);

What for?


> On Oct. 31, 2015, 2:08 a.m., David Edmundson wrote:
> > src/declarativeimports/calendar/daysmodel.cpp, line 63
> > <https://git.reviewboard.kde.org/r/125817/diff/4/?file=413168#file413168line63>
> > 
> > who deletes it?

Right, needs a qDeleteAll in ~


> On Oct. 31, 2015, 2:08 a.m., David Edmundson wrote:
> > src/declarativeimports/calendar/daysmodel.cpp, line 167
> > <https://git.reviewboard.kde.org/r/125817/diff/4/?file=413168#file413168line167>
> > 
> > Are you sure this works?
> > 
> > From what I see you're copying the event, then replacing the copy.
> > 
> > (though the autos make it confusing, so I may be wrong)

Yes, it does work. This looks through the stored events and replaces the stored one \
with the one that is passed as the method argument.


> On Oct. 31, 2015, 2:08 a.m., David Edmundson wrote:
> > src/declarativeimports/calendar/daysmodel.cpp, line 179
> > <https://git.reviewboard.kde.org/r/125817/diff/4/?file=413168#file413168line179>
> > 
> > this can be an invalid index, best to check it
> > 
> > (in each case we do this)

But then all it does is emit dataChanged() with invalid signal...but I'll add a check \
anyway.


> On Oct. 31, 2015, 2:08 a.m., David Edmundson wrote:
> > src/declarativeimports/calendar/daysmodel.cpp, line 209
> > <https://git.reviewboard.kde.org/r/125817/diff/4/?file=413168#file413168line209>
> > 
> > who owns this?
> > 
> > Q_INVOKABLE tries to be clever, which basically means I never know.
> > 
> > If QML owns it (which I think it does) you're potentially returning null values \
> > if this is called twice 
> > if you own it, you're leaking this if you have m_qmlData when the model is \
> > deleted

Ah, good spot. Should be owned by the model, ideally. All problems solved.


> On Oct. 31, 2015, 2:08 a.m., David Edmundson wrote:
> > src/declarativeimports/calendar/plasmacalendarintegration/calendareventsplugin.h, \
> > line 173 <https://git.reviewboard.kde.org/r/125817/diff/4/?file=413173#file413173line173>
> >  
> > Unless needed otherwise, I'd put the UID in the constructor.
> > 
> > If a plugin uses this, you screw everything up

> If a plugin uses this, you screw everything up

I don't follow. Note that uid is not a mandatory property. You can have events \
without uid. As the comment above it says, it's useful only if you want to implement \
eventModified/eventRemoved (so that it can locate the events in the model), which in \
case of eg. holidays is not needed, cause they are not going to be modified/removed. \
So there's no need to make those plugins more complex for no reason.


> On Oct. 31, 2015, 2:08 a.m., David Edmundson wrote:
> > src/declarativeimports/calendar/plasmacalendarintegration/calendareventsplugin.h, \
> > line 202 <https://git.reviewboard.kde.org/r/125817/diff/4/?file=413173#file413173line202>
> >  
> > rather than this much docs, would it make sense to have a protected method that \
> > takes a list, then in this class you turn that into the hash?

Well if the only reason to do that is because "there's too much to read", then no :P


- Martin


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


On Oct. 28, 2015, 6:18 p.m., Martin Klapetek wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125817/
> -----------------------------------------------------------
> 
> (Updated Oct. 28, 2015, 6:18 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  src/declarativeimports/calendar/plasmacalendarintegration/eventdata_p.cpp \
> PRE-CREATION  src/declarativeimports/calendar/plasmacalendarintegration/plasmacalendarintegration_export.h \
> 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
> 
> 


--===============3408604910798735441==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 8bit




<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 \
solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">  \
<tr>  <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/125817/">https://git.reviewboard.kde.org/r/125817/</a>
  </td>
    </tr>
   </table>
   <br />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On October 31st, 2015, 2:08 a.m. CET, <b>David \
Edmundson</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  


<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="https://git.reviewboard.kde.org/r/125817/diff/4/?file=413167#file413167line44" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/declarativeimports/calendar/daysmodel.h</a>  <span \
style="font-weight: normal;">

     (Diff revision 4)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">40</font></th>  <td bgcolor="#ffffff" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">44</font></th>  <td bgcolor="#ffffff" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  \
</tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I \
think we need some sort of</p> <p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;">QStringList availablePlugins()</p> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">setPlugins( QStringList plugins);</p></pre>  </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">What for?</p></pre> <br />

<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On October 31st, 2015, 2:08 a.m. CET, <b>David \
Edmundson</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  


<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="https://git.reviewboard.kde.org/r/125817/diff/4/?file=413168#file413168line63" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/declarativeimports/calendar/daysmodel.cpp</a>  <span \
style="font-weight: normal;">

     (Diff revision 4)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">63</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">              \
<span class="n">m_eventPlugins</span> <span class="o">&lt;&lt;</span> <span \
class="n">eventsPlugin</span><span class="p">;</span></pre></td>  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">who \
deletes it?</p></pre>  </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">Right, needs a qDeleteAll in ~</p></pre> <br />

<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On October 31st, 2015, 2:08 a.m. CET, <b>David \
Edmundson</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  


<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="https://git.reviewboard.kde.org/r/125817/diff/4/?file=413168#file413168line167" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/declarativeimports/calendar/daysmodel.cpp</a>  <span \
style="font-weight: normal;">

     (Diff revision 4)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">157</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            \
<span class="o">*</span><span class="n">i</span> <span class="o">=</span> <span \
class="n">data</span><span class="p">;</span></pre></td>  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Are \
you sure this works?</p> <p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;">From what I see you're copying the \
event, then replacing the copy.</p> <p style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: inherit;">(though the autos make \
it confusing, so I may be wrong)</p></pre>  </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">Yes, it does work. This looks through the stored events and replaces the \
stored one with the one that is passed as the method argument.</p></pre> <br />

<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On October 31st, 2015, 2:08 a.m. CET, <b>David \
Edmundson</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  


<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="https://git.reviewboard.kde.org/r/125817/diff/4/?file=413168#file413168line179" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/declarativeimports/calendar/daysmodel.cpp</a>  <span \
style="font-weight: normal;">

     (Diff revision 4)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">169</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span \
class="k">const</span> <span class="n">QModelIndex</span> <span \
class="n">changedIndex</span> <span class="o">=</span> <span \
class="n">indexForDate</span><span class="p">(</span><span class="n">date</span><span \
class="p">);</span></pre></td>  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">this \
can be an invalid index, best to check it</p> <p style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: inherit;">(in each case we do \
this)</p></pre>  </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">But then all it does is emit dataChanged() with invalid signal...but I'll \
add a check anyway.</p></pre> <br />

<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On October 31st, 2015, 2:08 a.m. CET, <b>David \
Edmundson</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  


<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="https://git.reviewboard.kde.org/r/125817/diff/4/?file=413168#file413168line209" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/declarativeimports/calendar/daysmodel.cpp</a>  <span \
style="font-weight: normal;">

     (Diff revision 4)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">199</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="n">QList</span><span class="o">&lt;</span><span class="n">QObject</span><span \
class="o">*&gt;</span> <span class="n">DaysModel</span><span class="o">::</span><span \
class="n">eventsForDate</span><span class="p">(</span><span class="k">const</span> \
<span class="n">QDate</span> <span class="o">&amp;</span><span \
class="n">date</span><span class="p">)</span></pre></td>  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">who \
owns this?</p> <p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Q_INVOKABLE tries to be clever, which basically means \
I never know.</p> <p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">If QML owns it (which I think it does) you're \
potentially returning null values if this is called twice</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">if \
you own it, you're leaking this if you have m_qmlData when the model is \
deleted</p></pre>  </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">Ah, good spot. Should be owned by the model, ideally. All problems \
solved.</p></pre> <br />

<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On October 31st, 2015, 2:08 a.m. CET, <b>David \
Edmundson</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  


<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="https://git.reviewboard.kde.org/r/125817/diff/4/?file=413173#file413173line173" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/declarativeimports/calendar/plasmacalendarintegration/calendareventsplugin.h</a>
  <span style="font-weight: normal;">

     (Diff revision 4)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">173</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="kt">void</span> <span class="nf">setUid</span><span class="p">(</span><span \
class="k">const</span> <span class="n">QString</span> <span \
class="o">&amp;</span><span class="n">uid</span><span class="p">);</span></pre></td>  \
</tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">Unless needed otherwise, I'd put the UID in the constructor.</p> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">If a plugin uses this, you screw everything up</p></pre>  </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><blockquote \
style="text-rendering: inherit;padding: 0 0 0 1em;border-left: 1px solid \
#bbb;white-space: normal;margin: 0 0 0 0.5em;line-height: inherit;"> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">If a plugin uses this, you screw everything up</p> </blockquote>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">I don't follow. Note that uid is not a mandatory \
property. You can have events without uid. As the comment above it says, it's useful \
only if you want to implement eventModified/eventRemoved (so that it can locate the \
events in the model), which in case of eg. holidays is not needed, cause they are not \
going to be modified/removed. So there's no need to make those plugins more complex \
for no reason.</p></pre> <br />

<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On October 31st, 2015, 2:08 a.m. CET, <b>David \
Edmundson</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  


<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="https://git.reviewboard.kde.org/r/125817/diff/4/?file=413173#file413173line202" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/declarativeimports/calendar/plasmacalendarintegration/calendareventsplugin.h</a>
  <span style="font-weight: normal;">

     (Diff revision 4)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">202</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="cm">     * @param data A hash containing a QDate key for the \
event</span></pre></td>  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">rather than this much docs, would it make sense to have a protected method \
that takes a list, then in this class you turn that into the hash?</p></pre>  \
</blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">Well if the only reason to do that is because "there's too much to read", \
then no :P</p></pre> <br />




<p>- Martin</p>


<br />
<p>On October 28th, 2015, 6:18 p.m. CET, Martin Klapetek wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: \
1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; \
-webkit-border-radius: 6px;">  <tr>
  <td>

<div>Review request for Plasma and Daniel Vrátil.</div>
<div>By Martin Klapetek.</div>


<p style="color: grey;"><i>Updated Oct. 28, 2015, 6:18 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
plasma-framework
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">This adds a simple plugin interface that can be \
subclassed and provide events integration with Plasma Calendar applet.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">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.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">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()).</p> <p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">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.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">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.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">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)</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>src/declarativeimports/calendar/CMakeLists.txt <span style="color: \
grey">(40ead91)</span></li>

 <li>src/declarativeimports/calendar/calendarplugin.cpp <span style="color: \
grey">(bafe80c)</span></li>

 <li>src/declarativeimports/calendar/daysmodel.h <span style="color: \
grey">(a5bdac9)</span></li>

 <li>src/declarativeimports/calendar/daysmodel.cpp <span style="color: \
grey">(2d059a8)</span></li>

 <li>src/declarativeimports/calendar/eventdatadecorator.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>src/declarativeimports/calendar/eventdatadecorator.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>src/declarativeimports/calendar/plasmacalendarintegration/CMakeLists.txt <span \
style="color: grey">(PRE-CREATION)</span></li>

 <li>src/declarativeimports/calendar/plasmacalendarintegration/PlasmaCalendarIntegrationConfig.cmake.in \
<span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/declarativeimports/calendar/plasmacalendarintegration/calendareventsplugin.h \
<span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/declarativeimports/calendar/plasmacalendarintegration/calendareventsplugin.cpp \
<span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/declarativeimports/calendar/plasmacalendarintegration/eventdata_p.cpp <span \
style="color: grey">(PRE-CREATION)</span></li>

 <li>src/declarativeimports/calendar/plasmacalendarintegration/plasmacalendarintegration_export.h \
<span style="color: grey">(PRE-CREATION)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/125817/diff/" style="margin-left: \
3em;">View Diff</a></p>






  </td>
 </tr>
</table>







  </div>
 </body>
</html>


--===============3408604910798735441==--


[Attachment #3 (text/plain)]

_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic