Skip to content

Commit 9a2393e

Browse files
committedOct 23, 2017
[Geometry checker] Qt < 5.9 compatibility fix
1 parent 972d14f commit 9a2393e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
 

‎tests/src/geometry_checker/testqgsgeometrychecks.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -981,20 +981,21 @@ QgsFeaturePool *TestQgsGeometryChecks::createFeaturePool( QgsVectorLayer *layer,
981981
QgsGeometryCheckerContext *TestQgsGeometryChecks::createTestContext( QTemporaryDir &tempDir, QMap<QString, QString> &layers, const QString &mapCrs, double prec ) const
982982
{
983983
QDir testDataDir( QDir( TEST_DATA_DIR ).absoluteFilePath( "geometry_checker" ) );
984+
QDir tmpDir( tempDir.path() );
984985

985986
QMap<QString, QgsFeaturePool *> featurePools;
986987
for ( const QString &layerFile : layers.keys() )
987988
{
988-
QFile( testDataDir.absoluteFilePath( layerFile ) ).copy( tempDir.filePath( layerFile ) );
989+
QFile( testDataDir.absoluteFilePath( layerFile ) ).copy( tmpDir.absoluteFilePath( layerFile ) );
989990
if ( layerFile.endsWith( ".shp", Qt::CaseInsensitive ) )
990991
{
991992
QString baseName = QFileInfo( layerFile ).baseName();
992-
QFile( testDataDir.absoluteFilePath( baseName + ".dbf" ) ).copy( tempDir.filePath( baseName + ".dbf" ) );
993-
QFile( testDataDir.absoluteFilePath( baseName + ".pri" ) ).copy( tempDir.filePath( baseName + ".pri" ) );
994-
QFile( testDataDir.absoluteFilePath( baseName + ".qpj" ) ).copy( tempDir.filePath( baseName + ".qpj" ) );
995-
QFile( testDataDir.absoluteFilePath( baseName + ".shx" ) ).copy( tempDir.filePath( baseName + ".shx" ) );
993+
QFile( testDataDir.absoluteFilePath( baseName + ".dbf" ) ).copy( tmpDir.absoluteFilePath( baseName + ".dbf" ) );
994+
QFile( testDataDir.absoluteFilePath( baseName + ".pri" ) ).copy( tmpDir.absoluteFilePath( baseName + ".pri" ) );
995+
QFile( testDataDir.absoluteFilePath( baseName + ".qpj" ) ).copy( tmpDir.absoluteFilePath( baseName + ".qpj" ) );
996+
QFile( testDataDir.absoluteFilePath( baseName + ".shx" ) ).copy( tmpDir.absoluteFilePath( baseName + ".shx" ) );
996997
}
997-
QgsVectorLayer *layer = new QgsVectorLayer( tempDir.filePath( layerFile ), layerFile );
998+
QgsVectorLayer *layer = new QgsVectorLayer( tmpDir.absoluteFilePath( layerFile ), layerFile );
998999
Q_ASSERT( layer && layer->isValid() );
9991000
layers[layerFile] = layer->id();
10001001
layer->dataProvider()->enterUpdateMode();

0 commit comments

Comments
 (0)
Please sign in to comment.