diff --git a/splitfile.cc b/splitfile.cc index 67daa3d5..9308f77e 100644 --- a/splitfile.cc +++ b/splitfile.cc @@ -60,6 +60,9 @@ bool SplitFile::open( QFile::OpenMode mode ) bool SplitFile::seek( quint64 pos ) { + if( offsets.isEmpty() ) + return false; + int fileNom; for( fileNom = 0; fileNom < offsets.size() - 1; fileNom++ ) @@ -74,6 +77,9 @@ bool SplitFile::seek( quint64 pos ) qint64 SplitFile::read( char *data, qint64 maxSize ) { + if( offsets.isEmpty() ) + return 0; + quint64 bytesReaded = 0; for( int i = currentFile; i < files.size(); i++ ) { @@ -117,7 +123,7 @@ bool SplitFile::getChar( char *c ) qint64 SplitFile::pos() const { - if( files.isEmpty() ) + if( offsets.isEmpty() ) return 0; return offsets.at( currentFile ) + files.at( currentFile )->pos(); diff --git a/zipfile.cc b/zipfile.cc index e2345a0b..837eb497 100644 --- a/zipfile.cc +++ b/zipfile.cc @@ -200,8 +200,17 @@ SplitZipFile::SplitZipFile( const QString & name ) void SplitZipFile::setFileName( const QString & name ) { - if( !name.toLower().endsWith( ".zip" ) ) - return; + { + QString lname = name.toLower(); + if( lname.endsWith( ".zips" ) ) + { + appendFile( name ); + return; + } + + if( !lname.endsWith( ".zip" ) ) + return; + } if( QFileInfo( name ).isFile() ) {