[KPhotoAlbum] Faking kim files to import photos

Dotan Cohen dotancohen at gmail.com
Thu Feb 23 14:18:43 GMT 2006


On 2/23/06, Martin Hoeller <martin at xss.co.at> wrote:
> On 23 Feb 2006, Dotan Cohen wrote:
>
> > When I try to import a kim file that was I left "generate thumbnails"
> > checked it works. So even KimDaBa's own .kim file is broken. Can
> > somebody confirm this? I am on KimDaBa 2.1 (Using KDE 3.5.1).
>
> Right. KPhotoAlbum is able to produce .kim files without thumbnails.
> Import of such files results in error messages. Nevertheless it is still
> possible to import the images and keywords from such a .kim file.
>
> The following patch fixes this behaviour. Note, that the latest SVN
> version doesn't compile so I patched against revision 508059.
>
> Index: import.cpp
> ===================================================================
> --- import.cpp  (revision 508059)
> +++ import.cpp  (working copy)
> @@ -262,10 +262,17 @@
>          ImageRow* ir = new ImageRow( info, this, container );
>          lay3->addWidget( ir->_checkbox, row, 0 );
>
> -        QPushButton* but = new QPushButton( container, "image" );
> -        but->setPixmap( loadThumbnail( info->fileName( true ) ) );
> -        lay3->addWidget( but, row, 1 );
> -        connect( but, SIGNAL( clicked() ), ir, SLOT( showImage() ) );
> +        const KArchiveEntry* thumbnails = _dir->entry( QString::fromLatin1( "Thumbnails" ) );
> +        if ( thumbnails ) {
> +            QPushButton* but = new QPushButton( container, "image" );
> +            but->setPixmap( loadThumbnail( info->fileName( true ) ) );
> +            lay3->addWidget( but, row, 1 );
> +            connect( but, SIGNAL( clicked() ), ir, SLOT( showImage() ) );
> +        }
> +        else {
> +            QLabel* label = new QLabel( info->label(), container, "filename" );
> +            lay3->addWidget( label, row, 1 );
> +        }
>
>          QLabel* label = new QLabel( QString::fromLatin1("<qt>%1</qt>").arg(info->description()), container, "description" );
>          lay3->addWidget( label, row, 2 );
>
>
> hth,
> - martin
>

Thanks, Martin! As I've never patched before, how do I apply this patch?


More information about the Kphotoalbum mailing list