Bug 132841 - tag filtering works only a the second click on the tag filter list
Summary: tag filtering works only a the second click on the tag filter list
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Tags-Engine (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-23 08:06 UTC by cm007
Modified: 2012-09-17 07:16 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 0.9.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cm007 2006-08-23 08:06:03 UTC
Version:            (using KDE KDE 3.5.1)
Installed from:    SuSE RPMs
OS:                Linux

To activate tag filtering one has to click on the tag filtering list on that tag you want to filter. But for filtering you need the click twice on that mentioned tag. 

How to reproduced:

Let us think of an album without tags. If one click once on a tag in the tag filtering list all pictures show be hided because the filter does not match any picture in the album. But nothing happens only the filter looks like it is activated but it is not. If one clicks a second time on the same filter alle pictures that does not match the filter will be hided. In this special case all pictures are hided.
The third click show all of them because then the filter is deactivated again.
Comment 1 caulier.gilles 2006-09-25 16:35:30 UTC
SVN commit 588239 by mwiesweg:

Fix two subtle but annoying bugs in TagFilterView:

- all items are CheckBoxControllers.
  Children-less controller items will enter the NoChange state after first click,
  so a second click is necessary to make the filter take effect.
  Set state to On directly in this case
- draw the checkbox three pixels to the right, as expected by Qt

CCMAIL: digikam-devel@kde.org


 M  +1 -1      folderitem.cpp  
 M  +10 -0     tagfilterview.cpp  


--- trunk/extragear/graphics/digikam/digikam/folderitem.cpp #588238:588239
@@ -199,7 +199,7 @@
         (type() == QCheckListItem::CheckBoxController))
     {
         int boxsize = fv->style().pixelMetric(QStyle::PM_CheckListButtonSize, fv); 
-        int x = 0;
+        int x = 3;
         int y = (height() - boxsize)/2 + margin;
         r += boxsize + 4;
 
--- trunk/extragear/graphics/digikam/digikam/tagfilterview.cpp #588238:588239
@@ -97,6 +97,16 @@
     {
         QCheckListItem::stateChange(val);
 
+        // All TagFilterViewItems are CheckBoxControllers. If they have no children,
+        // they should be of type CheckBox, but that is not possible with our way of adding items.
+        // When clicked, children-less items first change to the NoChange state, and a second
+        // click is necessary to set them to On and make the filter take effect.
+        // So set them to On if the condition is met.
+        if (!firstChild() && state() == NoChange)
+        {
+            setState(On);
+        }
+
         ((TagFilterView*)listView())->triggerChange();
     }