Moving KRatingWidget from Nepomuk to kdeui

Frederik Gladhorn gladhorn at kde.org
Mon Sep 13 20:11:25 BST 2010


Hi,
so today I ported knewstuff3 over to use the KRatingWidget from kdelibs.
I have some minor problems that would be easy to solve with some additional 
api in KRatingWidget.

Some items we have in knewstuff do have a rating but you cannot vote for it.
Currently the KRatingWidget will always be clickable, it would be nice, if I 
could add an "enabled" property (getter + setter) to the class.

The other problem I ran into was that the setter for the current rating will 
always emit the changed signal. So there is no way to easily use this widget 
in a KWidgetItemDelegate as I'm trying in knewstuff.
Adding a signal that is only emitted when the user actively changes the 
rating would be trivial. The old version I had copied to knewstuff did not 
show this behavior.

I would like to implement the suggested functions, unless someone suggests a 
better way.

Cheers
Frederik


Sebastian Trüg wrote:

> Thanks a lot Albert. :)
> 
> On 09/09/2010 11:38 PM, Albert Astals Cid wrote:
>> A Dimarts, 7 de setembre de 2010, Frederik Gladhorn va escriure:
>>> Am Montag 06 September 2010, 23:53:06 schrieb Albert Astals Cid:
>>>> A Dilluns, 6 de setembre de 2010, Sebastian Trüg va escriure:
>>>>> i am perfectly fine with that. :)
>>>>
>>>> I actually found that the classes are somewhat different, e.g.
>>>>
>>>> -     * Set the current rating. Calling this method will NOT trigger
>>>> the
>>>> -     * ratingChanged signal.
>>>> +     * Set the current rating. Calling this method will trigger the
>>>> +     * ratingChanged signal if @p rating is different from the
>>>> previous rating.
>>>>
>>>>       */
>>>>      
>>>>      void setRating( int rating );
>>>>
>>>> Frederik, do you really need that behaviour to be different in
>>>> knewstuff?
>>>
>>> Actually I think the change you mentioned above is just the nepomuk
>>> version being more up to date. When I used this in knewstuff, I didn't
>>> think it would be possible to move the class.
>>> The most significant change on my side was that I wanted a read only
>>> widget. But this requirement is gone, since with newer versions of
>>> attica (which will be used in kde 4.6, patch is already done here
>>> locally) we will have a range of ratings and use the widget properly.
>>>
>>> So please just move the nepomuk version, I'll port knewstuff shortly.
>> 
>> Moved, your tourn to port knewstuff.
>> 
>> Albert
>> 
>>>
>>> Cheers
>>> Frederik
>>>
>>>> Albert
>>>>
>>>>> On 09/04/2010 10:46 PM, Albert Astals Cid wrote:
>>>>>> I just realized  knewstuff and nepomuk have copies of the same code
>>>>>> (KRatingWidget), as far as i remember someone (Thiago?) said it was
>>>>>> binary compatible to move classes to an library if it was guaranteed
>>>>>> that everyone that linked to library were the code was previous also
>>>>>> linked to the new one, since nepomuk already links to kdeui that
>>>>>> should be ok.
>>>>>>
>>>>>> So if my remembering is correct, can i do the movement?
>>>>>>
>>>>>> Albert
>>




More information about the kde-core-devel mailing list