Skip to content
Permalink
Browse files

use temp copy of points.shp

  • Loading branch information
signedav committed Dec 10, 2018
1 parent 73e3ead commit 8fda2b7df81a0b568e2282321b87861e5e750c19
Showing with 7 additions and 2 deletions.
  1. +7 −2 tests/src/core/testqgsofflineediting.cpp
@@ -41,6 +41,7 @@ class TestQgsOfflineEditing : public QObject
QStringList layerIds;
long numberOfFeatures;
int numberOfFields;
QTemporaryDir tempDir;

private slots:
void initTestCase();// will be called before the first testfunction is executed.
@@ -75,8 +76,12 @@ void TestQgsOfflineEditing::cleanupTestCase()
void TestQgsOfflineEditing::init()
{
QString myFileName( TEST_DATA_DIR ); //defined in CmakeLists.txt
myFileName = myFileName + "/points.shp";
QFileInfo myMapFileInfo( myFileName );
QString myTempDirName = tempDir.path();
QFile::copy( myFileName + "/points.shp", myTempDirName + "/points.shp" );
QFile::copy( myFileName + "/points.shx", myTempDirName + "/points.shx" );
QFile::copy( myFileName + "/points.dbf", myTempDirName + "/points.dbf" );
QString myTempFileName = myTempDirName + "/points.shp";
QFileInfo myMapFileInfo( myTempFileName );
mpLayer = new QgsVectorLayer( myMapFileInfo.filePath(),
myMapFileInfo.completeBaseName(), QStringLiteral( "ogr" ) );
QgsProject::instance()->addMapLayer( mpLayer );

0 comments on commit 8fda2b7

Please sign in to comment.
You can’t perform that action at this time.