@@ -33,9 +33,12 @@ class TestQgsApplication: public QObject
33
33
void TestQgsApplication::getPaths ()
34
34
{
35
35
// init QGIS's paths - true means that all path will be inited from prefix
36
- QString qgisPath = QCoreApplication::applicationDirPath () + " /../ " ;
36
+ QString qgisPath = QCoreApplication::applicationDirPath ();
37
37
QgsApplication::setPrefixPath (qgisPath, TRUE );
38
-
38
+ #ifdef Q_OS_LINUX
39
+ QgsApplication::setPkgDataPath (qgisPath + " /../share/qgis" );
40
+ QgsApplication::setPluginPath (qgisPath + " /../lib/qgis" );
41
+ #endif
39
42
std::cout << " Prefix PATH: " << QgsApplication::prefixPath ().toLocal8Bit ().data () << std::endl;
40
43
std::cout << " Plugin PATH: " << QgsApplication::pluginPath ().toLocal8Bit ().data () << std::endl;
41
44
std::cout << " PkgData PATH: " << QgsApplication::pkgDataPath ().toLocal8Bit ().data () << std::endl;
@@ -45,8 +48,12 @@ void TestQgsApplication::getPaths()
45
48
46
49
void TestQgsApplication::checkTheme ()
47
50
{
48
- QString qgisPath = QCoreApplication::applicationDirPath () + " /../ " ;
51
+ QString qgisPath = QCoreApplication::applicationDirPath ();
49
52
QgsApplication::setPrefixPath (qgisPath, TRUE );
53
+ #ifdef Q_OS_LINUX
54
+ QgsApplication::setPkgDataPath (qgisPath + " /../share/qgis" );
55
+ QgsApplication::setPluginPath (qgisPath + " /../lib/qgis" );
56
+ #endif
50
57
std::cout << " Prefix PATH: " << QgsApplication::prefixPath ().toLocal8Bit ().data () << std::endl;
51
58
std::cout << " Plugin PATH: " << QgsApplication::pluginPath ().toLocal8Bit ().data () << std::endl;
52
59
std::cout << " PkgData PATH: " << QgsApplication::pkgDataPath ().toLocal8Bit ().data () << std::endl;
0 commit comments