[KPhotoAlbum] Token setting in thumbnail view

Robert Krawitz rlk at alum.mit.edu
Sat Jul 20 02:46:01 CEST 2013


On Wed, 17 Jul 2013 16:30:48 -0400, Robert Krawitz wrote:
> On Wed, 17 Jul 2013 22:28:07 +0200, Johannes Zarl wrote:
>> Hi,
>>
>> I just had another look at the patch. Is it intentional that expanded stacks behave like unstacked images? I.e. when there is an expanded stack consisting of two images, uppercase letters only affect the selected image, not the whole stack.
>>
>> My feeling is that uppercase letters should always affect the whole stack. How about you?
>
> Yes.  I thought that that was what I was doing, but I'm not familiar
> with the innards of the stacking.

Actually, now that I think about it, the behavior I coded is indeed what
I intended.  Whether it's the best behavior is open to debate (I can see
both sides), but my thought process was that if the stack is expanded
and you've selected only some of the stack members, then you've made a
deliberate choice to exclude the others.

On the flip side, if you've specified that you want all members of the
stack, presumably that's what you mean.  That case seems ambiguous to
me.  I don't feel all that strongly about it; if others agree that
IncludeAllStacks is the right behavior, I'll be happy to change it.

>> On Monday 08 July 2013 18:41:23 Johannes Zarl wrote:
>>> Functionality-wise, the patch seems worthwhile, and it also is pretty
>>> straight-forward and works as expected.
>>> 
>>> I'm wondering how to best advertise the feature to the users, though. IMO
>>> there is no possibility for a new user to find this functionality, except by
>>> pure chance.
>>> 
>>>   Johannes
>>> 
>>> On Sunday 07 July 2013 02:15:49 Robert Krawitz wrote:
>>> > The following patch allows you to set/clear a token for all members of a
>>> > stack when in thumbnail view by typing an uppercase letter (similarly
>>> > for rating).
>>> > 
>>> > diff --git a/ThumbnailView/KeyboardEventHandler.cpp
>>> > b/ThumbnailView/KeyboardEventHandler.cpp index 9c341d1..e6a7195 100644
>>> > --- a/ThumbnailView/KeyboardEventHandler.cpp
>>> > +++ b/ThumbnailView/KeyboardEventHandler.cpp
>>> > @@ -34,12 +34,12 @@
>>> > ThumbnailView::KeyboardEventHandler::KeyboardEventHandler(
>>> > ThumbnailFactory* fac
>>> > 
>>> >  bool ThumbnailView::KeyboardEventHandler::keyPressEvent( QKeyEvent* event
>>> > 
>>> > ) {
>>> > -    if ( event->modifiers() == Qt::NoModifier && ( event->key() >> > Qt::Key_A && event->key() <= Qt::Key_Z ) ) { +    if ( (
>>> > event->modifiers() == Qt::NoModifier || event->modifiers() ==
>>> > Qt::ShiftModifier )  && ( event->key() >= Qt::Key_A && event->key() <> > Qt::Key_Z ) ) { QString token = event->text().toUpper().left(1);
>>> > 
>>> >          bool mustRemoveToken = false;
>>> >          bool hadHit          = false;
>>> > 
>>> > -        const DB::FileNameList selection > > widget()->selection(NoExpandCollapsedStacks); +        const
>>> > DB::FileNameList selection = widget()->selection( event->modifiers() ==
>>> > Qt::NoModifier ? NoExpandCollapsedStacks : ExpandCollapsedStacks );
>>> > Q_FOREACH( const DB::FileName& fileName, selection ) {
>>> > 
>>> >              DB::ImageInfoPtr info = fileName.info();
>>> >              if ( ! hadHit ) {
>>> > 
>>> > @@ -60,11 +60,11 @@ bool
>>> > ThumbnailView::KeyboardEventHandler::keyPressEvent( QKeyEvent* event )
>>> > return true;
>>> > 
>>> >      }
>>> > 
>>> > -    if ( event->modifiers() == Qt::NoModifier && ( event->key() >> > Qt::Key_0 && event->key() <= Qt::Key_5 ) ) { +    if ( (
>>> > event->modifiers() == Qt::NoModifier || event->modifiers() ==
>>> > Qt::ShiftModifier ) && ( event->key() >= Qt::Key_0 && event->key() <> > Qt::Key_5 ) ) { bool ok;
>>> > 
>>> >          short rating = event->text().left(1).toShort(&ok, 10);
>>> >          if (ok) {
>>> > 
>>> > -            const DB::FileNameList selection = widget()->selection(
>>> > NoExpandCollapsedStacks ); +            const DB::FileNameList selection > > widget()->selection( event->modifiers() == Qt::NoModifier ?
>>> > NoExpandCollapsedStacks : ExpandCollapsedStacks ); Q_FOREACH( const
>>> > DB::FileName& fileName, selection ) { DB::ImageInfoPtr info > > fileName.info();
>>> > 
>>> >                  info->setRating(rating * 2);

-- 
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