@@ -51,28 +51,30 @@ void TestQgsVectorAnalyzer::initTestCase()
51
51
//
52
52
// init QGIS's paths - true means that all path will be inited from prefix
53
53
QString qgisPath = QCoreApplication::applicationDirPath ();
54
- QgsApplication::setPrefixPath (INSTALL_PREFIX, true );
54
+ QgsApplication::init ( INSTALL_PREFIX );
55
+ QgsApplication::initQgis ( );
55
56
QgsApplication::showSettings ();
56
57
// Instantiate the plugin directory so that providers are loaded
57
58
QgsProviderRegistry::instance (QgsApplication::pluginPath ());
58
59
59
60
// create some objects that will be used in all tests...
60
61
// create a map layer that will be used in all tests...
61
- QString myFileName (TEST_DATA_DIR); // defined in CmakeLists.txt
62
+ QString myBaseFileName (TEST_DATA_DIR); // defined in CmakeLists.txt
62
63
QString myEndName = " lines.shp" ;
63
- myFileName = myFileName + QDir::separator () + myEndName;
64
+ QString myFileName = myBaseFileName + QDir::separator () + myEndName;
65
+ qDebug () << myFileName;
64
66
QFileInfo myLineInfo ( myFileName );
65
67
mpLineLayer = new QgsVectorLayer ( myLineInfo.filePath (),
66
68
myLineInfo.completeBaseName (), " ogr" );
67
69
68
70
myEndName = " polys.shp" ;
69
- myFileName = myFileName + QDir::separator () + myEndName;
71
+ myFileName = myBaseFileName + QDir::separator () + myEndName;
70
72
QFileInfo myPolyInfo ( myFileName );
71
73
mpPolyLayer = new QgsVectorLayer ( myPolyInfo.filePath (),
72
74
myPolyInfo.completeBaseName (), " ogr" );
73
75
74
76
myEndName = " points.shp" ;
75
- myFileName = myFileName + QDir::separator () + myEndName;
77
+ myFileName = myBaseFileName + QDir::separator () + myEndName;
76
78
QFileInfo myPointInfo ( myFileName );
77
79
mpPointLayer = new QgsVectorLayer ( myPointInfo.filePath (),
78
80
myPointInfo.completeBaseName (), " ogr" );
0 commit comments