Skip to content

Commit

Permalink
ziplayertest fix
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Dec 12, 2014
1 parent 40e0d78 commit 69b27f0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/src/core/testziplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,22 @@ bool TestZipLayer::testZipItem( QString myFileName, QString myChildName, QString
QFileInfo myFileInfo( myFileName );
QgsZipItem *myZipItem = new QgsZipItem( NULL, myFileInfo.fileName(), myFileName );
myZipItem->populate();
// wait until populated in separate thread
QTime time;
time.start();
while ( myZipItem->state() != QgsDataItem::Populated && time.elapsed() < 5000 )
{
QTest::qSleep ( 100 );
QCoreApplication::processEvents();
}
QgsDebugMsg( QString( "time.elapsed() = %1 ms" ).arg ( time.elapsed() ) );
bool ok = false;
QString driverName;
QVector<QgsDataItem*> myChildren = myZipItem->children();

QgsDebugMsg( QString( "has %1 items" ).arg( myChildren.size() ) );
if ( myChildren.size() > 0 )
{
QgsDebugMsg( QString( "has %1 items" ).arg( myChildren.size() ) );
foreach ( QgsDataItem* item, myChildren )
{
QgsDebugMsg( QString( "child name=%1" ).arg( item->name() ) );
Expand Down

0 comments on commit 69b27f0

Please sign in to comment.