[KPhotoAlbum] Problems with the context menu in image view

Robert Krawitz rlk at alum.mit.edu
Sat Sep 11 01:47:42 CEST 2010

A couple of problems I've found related in a general sense to the
context menu in image view:

1) Invoke External Progam is *extremely* slow.  The first time I use
   it on a fresh session, it takes several minutes (!) to pop up the
   list of programs.  It appears the culprit is this, in

        // Fetch set of offers
        OfferType offers;
        if ( which == 0 )
            offers = appInfos( QStringList() << current->fileName(DB::AbsolutePath) );
            offers = appInfos( imageList );

   appInfos(), in turn, calls mimeTypes(), which then does this:

QString MainWindow::ExternalPopup::mimeType( const QString& file )
    return KFileItem( KFileItem::Unknown, KFileItem::Unknown, KUrl(file) ).mimetype();

   which seems to at least have to stat every file.  It's still pretty
   slow on successive runs (takes 20-30 seconds -- plenty of time to
   slap a debugger on it and catch it in the act).  If you have a
   small selection of active images, it's probably not much of a
   problem, but if you're in a view with all of your images -- and I
   currently have over 30,000, which isn't really that many -- this is

   I'm not sure how best to solve this.  My preference would be to
   have the mime type computed when images are read in, but I could
   see this being problematic if a system upgrade resulted in a file
   somehow having a different mime type.  But this is a major

   The problem is compounded by the fact that it's very easy to roll
   over this if you right click on the image to do something like look
   at the EXIF info, which is lower down on the menu.  If you don't
   move past this item fast enough, it tries to activate Invoke
   External Program, but the mouse is grabbed at this point, so you're
   locked into it until it finishes groveling all the images.

2) Show EXIF Information pops up a window with the EXIF information
   for the current image.  If you advance to the next image (or
   otherwise navigate through the images), the window isn't updated.
   So it's necessary to right click/Show EXIF Information each time.
   And there's no keyboard accelerator to pop it.

Robert Krawitz                                     <rlk at alum.mit.edu>

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