Don't stop loading if document contains no Pictures directory...

svn path=/trunk/playground/graphics/okular/; revision=585227
This commit is contained in:
Tobias Koenig 2006-09-16 16:17:31 +00:00
parent dd5b91ca40
commit c4ace82830

View file

@ -55,16 +55,14 @@ bool Document::open()
file = static_cast<const KArchiveFile*>( directory->entry( "meta.xml" ) );
mMeta = file->data();
if ( !entries.contains( "Pictures" ) ) {
return false;
}
if ( entries.contains( "Pictures" ) ) {
const KArchiveDirectory *imagesDirectory = static_cast<const KArchiveDirectory*>( directory->entry( "Pictures" ) );
const KArchiveDirectory *imagesDirectory = static_cast<const KArchiveDirectory*>( directory->entry( "Pictures" ) );
const QStringList imagesEntries = imagesDirectory->entries();
for ( int i = 0; i < imagesEntries.count(); ++i ) {
file = static_cast<const KArchiveFile*>( imagesDirectory->entry( imagesEntries[ i ] ) );
mImages.insert( QString( "Pictures/%1" ).arg( imagesEntries[ i ] ), file->data() );
const QStringList imagesEntries = imagesDirectory->entries();
for ( int i = 0; i < imagesEntries.count(); ++i ) {
file = static_cast<const KArchiveFile*>( imagesDirectory->entry( imagesEntries[ i ] ) );
mImages.insert( QString( "Pictures/%1" ).arg( imagesEntries[ i ] ), file->data() );
}
}
zip.close();