[KPhotoAlbum] Faking kim files to import photos

Martin Hoeller martin at xss.co.at
Thu Feb 23 13:19:22 GMT 2006


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

-- 
    mailto:martin.hoeller at xss.co.at  | Microsoft is not the answer.
http://stud3.tuwien.ac.at/~e9926483  |  Microsoft is the question.
                       icq:45563199  |      NO is the answer.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kphotoalbum/attachments/20060223/9aa5e563/attachment.sig>


More information about the Kphotoalbum mailing list