Skip to content

Commit 3fc80ad

Browse files
author
homann
committed
Path fix for renderer test
git-svn-id: http://svn.osgeo.org/qgis/trunk@7938 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 665cdf6 commit 3fc80ad

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

tests/src/core/testqgsrenderers.cpp

+15-4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class TestQgsRenderers: public QObject
4242
{
4343
Q_OBJECT;
4444
private slots:
45+
QString getQgisPath(); // Gets the path to QGIS installation
4546
void initTestCase();// will be called before the first testfunction is executed.
4647
void cleanupTestCase();// will be called after the last testfunction was executed.
4748
void init(){};// will be called before each testfunction is executed.
@@ -62,14 +63,24 @@ class TestQgsRenderers: public QObject
6263
QString mReport;
6364
};
6465

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+
6576
void TestQgsRenderers::initTestCase()
6677
{
6778
// 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);
7081
#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");
7384
#endif
7485
// Instantiate the plugin directory so that providers are loaded
7586
QgsProviderRegistry::instance(QgsApplication::pluginPath());

0 commit comments

Comments
 (0)