File tree 1 file changed +15
-4
lines changed
1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ class TestQgsRenderers: public QObject
42
42
{
43
43
Q_OBJECT;
44
44
private slots:
45
+ QString getQgisPath (); // Gets the path to QGIS installation
45
46
void initTestCase ();// will be called before the first testfunction is executed.
46
47
void cleanupTestCase ();// will be called after the last testfunction was executed.
47
48
void init (){};// will be called before each testfunction is executed.
@@ -62,14 +63,24 @@ class TestQgsRenderers: public QObject
62
63
QString mReport ;
63
64
};
64
65
66
+ QString TestQgsRenderers::getQgisPath ()
67
+ {
68
+ #ifdef Q_OS_LINUX
69
+ QString qgisPath = QCoreApplication::applicationDirPath () + " /../" ;
70
+ #else // mac and win
71
+ QString qgisPath = QCoreApplication::applicationDirPath () ;
72
+ #endif
73
+ return qgisPath;
74
+ }
75
+
65
76
void TestQgsRenderers::initTestCase ()
66
77
{
67
78
// init QGIS's paths - true means that all path will be inited from prefix
68
- QString qgisPath = QCoreApplication::applicationDirPath ();
69
- QgsApplication::setPrefixPath (qgisPath , TRUE );
79
+ // QString qgisPath = QCoreApplication::applicationDirPath ();
80
+ QgsApplication::setPrefixPath (getQgisPath () , TRUE );
70
81
#ifdef Q_OS_LINUX
71
- QgsApplication::setPkgDataPath (qgisPath + " /../share/qgis" );
72
- QgsApplication::setPluginPath (qgisPath + " /../lib/qgis" );
82
+ // QgsApplication::setPkgDataPath(qgisPath + "/../share/qgis");
83
+ // QgsApplication::setPluginPath(qgisPath + "/../lib/qgis");
73
84
#endif
74
85
// Instantiate the plugin directory so that providers are loaded
75
86
QgsProviderRegistry::instance (QgsApplication::pluginPath ());
You can’t perform that action at this time.
0 commit comments