Bug 151357

Summary: Ratings can exceed 5 stars
Product: [Applications] digikam Reporter: Mark Williamson <maw48>
Component: Tags-RatingAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In: 0.9.3
Attachments: ensure rating<=5 when dragging with the mouse

Description Mark Williamson 2007-10-26 01:52:32 UTC
Version:           0.9.2-final (using KDE 3.5.8, Kubuntu (gutsy) 4:3.5.8-0ubuntu3.1)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.22-14-386

Ratings for a picture are able to exceed 5 stars, which doesn't appear intentional!

To reproduce: click and hold within the stars on the rating "meter" in the comments / tags sidebar.  Then drag right to increase the rating.  Drag beyond the limit of the rating widget and then release.  Apply this and the picture will display a rating greater than 5 stars.
Comment 1 Arnd Baecker 2007-10-26 07:50:24 UTC
Hi Mark,

thanks for the report! I can reproduce and it seems simple
to fix, compile is running...
(note: B.K.O web-interface  seems broken, so I don't know
when I can attach the fix - if the fix works ;-)

Best, Arnd
Comment 2 Arnd Baecker 2007-10-26 08:08:25 UTC
Created attachment 21914 [details]
ensure rating<=5 when dragging with the mouse

In RatingWidget::mouseMoveEvent it was possible to generate
values >=5 for the position of the mouse (values < 0 are not possible
as the mouse position is always >=0). This
value was directly used as d->rating.
The attached patch ensures that pos<=RatingMax.
Comment 3 Arnd Baecker 2007-10-26 18:52:56 UTC
SVN commit 729686 by abaecker:

Ensure that rating cannot be larger than RatingMax when dragging the mouse.

CCBUGS: 151357
TODO:KDE4PORT



 M  +2 -1      NEWS  
 M  +2 -0      digikam/ratingwidget.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=729686
Comment 4 Arnd Baecker 2007-10-26 19:15:27 UTC
SVN commit 729699 by abaecker:

Ensure that rating cannot be smaller than RatingMin when dragging the mouse.

CCBUGS: 151357
TODO:KDE4PORT



 M  +2 -0      ratingwidget.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=729699
Comment 5 caulier.gilles 2007-10-30 08:23:13 UTC
patch backported to KDE4. I close this file now.

Gilles Caulier
Comment 6 Mark Williamson 2007-10-30 14:23:14 UTC
Hi!

Thanks, I'm glad I could help.  Don't worry about getting the patch online on my account; I'm happy to know it's fixed.  It's not really causing me much difficulty (although finding 7 star rating pictures is a bit surprising!), I'm just glad my sloppy mouse work led me to find something useful ;-)

Digikam is awesome!

Cheers,
Mark