Review Request: Add setSubTitlePolicy() method to Plasma::Delegate

Dmitry Suzdalev dimsuz at gmail.com
Thu Aug 20 19:15:12 CEST 2009



> On 2009-08-20 10:03:58, Aaron Seigo wrote:
> > why isn't the model returning an appropriate negative value for the subtitle?

This whole discussion raised because of this: by default, Plasma::Delegate has the policy of automatically adding subtitles if two adjasent items are of the same content. I questioned why this should be the default - for example while writing a klipper plasmoid I found this as a surprise - and we discussed the addition of such api.
Though later (after i published the review), me and mart agreed that maybe it's not really necessary to have the api changed, maybe the only change in the end would be the addition of that part of logic which would not try to be that clever if QVariant() is returned for SubTitleMandatoryRole (i.e. if model doesn't implement returning something for this role).

Otherwise it appears that model cannot have exact control where to show and where not to show title. For example, even if it implements returning 'true' for some items and 'false' for other items, the items with 'false' will still be auto-disambiguated inside a delegate.

So the main point now is to leave only checking for data validity of SubTitleMandatoryRole, and do disambiguating *only* if model doesn't care.

I've yet to update this review with the actual patch.


- Dmitry


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/1357/#review2091
-----------------------------------------------------------


On 2009-08-18 21:59:39, Dmitry Suzdalev wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/1357/
> -----------------------------------------------------------
> 
> (Updated 2009-08-18 21:59:39)
> 
> 
> Review request for Plasma and Aaron Seigo.
> 
> 
> Summary
> -------
> 
> This adds more control of showing subtitles with Plasma::Delegate by adding a setSubtitlePolicy() method to its API.
> Discussed briefly on #plasma with notmart, now on to review :)
> 
> 
> Diffs
> -----
> 
>   trunk/KDE/kdelibs/plasma/delegate.h 1011618 
>   trunk/KDE/kdelibs/plasma/delegate.cpp 1011618 
> 
> Diff: http://reviewboard.kde.org/r/1357/diff
> 
> 
> Testing
> -------
> 
> Tested with klipper applet by putting it in all modes possible (at least all i can come up with :))
> 
> 
> Thanks,
> 
> Dmitry
> 
>



More information about the Plasma-devel mailing list