File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ class TestQgsOfflineEditing : public QObject
41
41
QStringList layerIds;
42
42
long numberOfFeatures;
43
43
int numberOfFields;
44
+ QTemporaryDir tempDir;
44
45
45
46
private slots:
46
47
void initTestCase ();// will be called before the first testfunction is executed.
@@ -75,8 +76,12 @@ void TestQgsOfflineEditing::cleanupTestCase()
75
76
void TestQgsOfflineEditing::init ()
76
77
{
77
78
QString myFileName ( TEST_DATA_DIR ); // defined in CmakeLists.txt
78
- myFileName = myFileName + " /points.shp" ;
79
- QFileInfo myMapFileInfo ( myFileName );
79
+ QString myTempDirName = tempDir.path ();
80
+ QFile::copy ( myFileName + " /points.shp" , myTempDirName + " /points.shp" );
81
+ QFile::copy ( myFileName + " /points.shx" , myTempDirName + " /points.shx" );
82
+ QFile::copy ( myFileName + " /points.dbf" , myTempDirName + " /points.dbf" );
83
+ QString myTempFileName = myTempDirName + " /points.shp" ;
84
+ QFileInfo myMapFileInfo ( myTempFileName );
80
85
mpLayer = new QgsVectorLayer ( myMapFileInfo.filePath (),
81
86
myMapFileInfo.completeBaseName (), QStringLiteral ( " ogr" ) );
82
87
QgsProject::instance ()->addMapLayer ( mpLayer );
You can’t perform that action at this time.
0 commit comments