Skip to content

Commit

Permalink
ADD: Prepend zeroes on extracted files number to always be 4 digits, …
Browse files Browse the repository at this point in the history
…to improve filename sorting
  • Loading branch information
spillerrec committed Jul 18, 2017
1 parent fbf336c commit 006ae45
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/FileUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ QList<std::pair<QString,QImage>> extract_files( QString filename ){
QImage img;

int i=0;
while( reader.read( &img ) )
files.append( { QString::number( i++ ), img } );
while( reader.read( &img ) ){
auto index = QString( "%1" ).arg( i++, 4, 10, QChar{'0'} );
files.append( { index, img } );
}

return files;
}
Expand Down

0 comments on commit 006ae45

Please sign in to comment.