[KPhotoAlbum] Strange behaviour of tagging dialog in hierarchical view

Robert Krawitz rlk at alum.mit.edu
Sun Mar 31 17:02:51 BST 2013


On Sun, 31 Mar 2013 11:47:00 +0200, Martin Jost wrote:
> Am 30.03.2013 16:19, schrieb Robert Krawitz:
>> On Sat, 30 Mar 2013 15:58:57 +0100, Martin Jost wrote:
>>> I just feel confused by the behaviour of KPA 4.4.
>
>>> Now here is my current problem:
>>> I had the KPA tagging dialog open and switched to tree view.
>>> The current foto is untagged. I click "Freudenstadt" - and KPA not only
>>> switches this on, but also all sub-categories below Freudenstadt
>>> (Empfingen, Kniebis, Zollernstraße, ...)
>>>
>>> Problem 1:
>>> This doesn't happen every time, but only sometimes. What is the "rule"
>>> behind this ?
>>>
>>> Problem 2:
>>> I consider this plain wrong. If the photo belongs to "Freudenstadt", it
>>> doesn't belong to Empfingen and Kniebis and ...
>>> (If the hierarchy would be
>>> Europe
>>>   Germany
>>>   France
>>>   Spain
>>>   ...
>>> Surely a photo taken somewhere in Europe isn't taken in Germany, France,
>>> Spain, ... all at the same time.)
>>>
>>> Worse: If I would now add "Norway" below "Europe", KPA surely wouldn't
>>> add "Norway" to all photos tagged "Europe" previously - only the newly
>>> ones would get tagged this way.
>>>
>>> What is the reason/motivation behind this behaviour ?
>> 
>> I believe this is a bug that was fixed post-4.4, in commits
>> 585656c14b60e280fad05bc9dde19771df807c5b (Feb. 19) and later slightly
>> differently in 17e43680e78eb090947c6cfc9bf310486dffa12c (Mar. 6).
>
> Hello,
>
> sorry, please ignore - once more - my git-ignorance. (I'm used to CVS
> and SVN).
> I tried to apply these changes to my 4.4 copy.
> Here is what I did:
>
> Searched for the hashes: (First March 6)
>
>> git log (and searching for the hash): (my emphasize)
>
>> commit >>>>>>>>>>>>>>>>>>>>17e43680e78eb090947c6cfc9bf310486dffa12c<<<<<<<<<<<<<<<<<<<<<
>> Author: Reimar Imhof <Reimar.Imhof at netcologne.de>
>> Date:   Wed Mar 6 18:50:48 2013 +0200
>> 
>>     In configureItem I removed the setTristate-call because I've found the
>>     following hint from
>>     http://lists.trolltech.com/qt-interest/2008-04/thread00080-0.html: "The
>>     intended usage of Qt::ItemIsTristate is to signify that the checked
>>     state of an item should be computed as a function of the  checked states
>>     of its child items; e.g. no child items checked =>  parent becomes
>>     unchecked; some child items checked => parent is  partially checked; all
>>     child items checked => parent item checked."
>> 
>> commit 24be3677d183dd3d21dd120361097cc6b8815f8a
>> Author: Johannes Zarl <isilmendil at isilme.lupus.uberspace.de>
>> Date:   Wed Feb 27 23:01:59 2013 +0100
>> 
>>     Make EXIF label search more obvious.
>
> Get the diff:
>git diff 24be3677d183dd3d21dd120361097cc6b8815f8a 17e43680e78eb090947c6cfc9bf310486dffa12c
>
> That should be the right "direction" for the diff - isn't it ?

You're going to need both of the diffs (or just manually make the
change), since they both touch the same code.

This is what you actually want.

void AnnotationDialog::ListSelect::setMode( UsageMode mode )
{
    _mode = mode;
    _lineEdit->setMode( mode );
    if ( mode == SearchMode ) {
        // "0" below is sorting key which ensures that None is always at top.
        CheckDropItem* item = new CheckDropItem( _treeWidget, DB::ImageDB::NONE(), QString::fromLatin1("0") );
        configureItem( item );
        _and->show();
        _or->show();
        _or->setChecked( true );
        _showSelectedOnly->hide();
    } else {
        _and->hide();
        _or->hide();
        _showSelectedOnly->show();
    }
    for ( QTreeWidgetItemIterator itemIt( _treeWidget ); *itemIt; ++itemIt )
        configureItem( dynamic_cast<CategoryListView::CheckDropItem*>(*itemIt) );

    // ensure that the selection count indicator matches the current mode:
    updateSelectionCount();
}

-- 
Robert Krawitz                                     <rlk at alum.mit.edu>

MIT VI-3 1987 - Congrats MIT Engineers 5 straight men's hoops tourney
Tall Clubs International  --  http://www.tall.org/ or 1-888-IM-TALL-2
Member of the League for Programming Freedom  --  http://ProgFree.org
Project lead for Gutenprint   --    http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton



More information about the Kphotoalbum mailing list