Use qgisapp path properly for quickprint test too

git-svn-id: http://svn.osgeo.org/qgis/trunk@8718 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
timlinux 2008-07-06 22:39:11 +00:00
parent 786ca98eea
commit 797ff2c7fa
2 changed files with 7 additions and 24 deletions

View File

@ -43,6 +43,7 @@ ENDIF (WIN32)
# the TEST_DATA_DIR variable is set in the top level CMakeLists.txt
ADD_DEFINITIONS(-DTEST_DATA_DIR="\\"${TEST_DATA_DIR}\\"")
ADD_DEFINITIONS(-DINSTALL_PREFIX="\\"${CMAKE_INSTALL_PREFIX}\\"")
#############################################################
# libraries

View File

@ -46,7 +46,6 @@ class TestQgsQuickPrint: public QObject
void cleanup(){};// will be called after every testfunction.
void basicMapTest();
QString getQgisPath(); // Gets the path to QGIS installation
private:
bool imageCheck(QString theType); //as above
QgsMapRender * mpMapRenderer;
@ -57,35 +56,18 @@ class TestQgsQuickPrint: public QObject
QString mReport;
};
QString TestQgsQuickPrint::getQgisPath()
{
#ifdef Q_OS_LINUX
QString qgisPath = QCoreApplication::applicationDirPath () + "/../";
#else //mac and win
QString qgisPath = QCoreApplication::applicationDirPath () ;
#endif
return qgisPath;
}
void TestQgsQuickPrint::initTestCase()
{
//
// Runs once before any tests are run
//
// init QGIS's paths - true means that all path will be inited from prefix
//QString qgisPath = QCoreApplication::applicationDirPath ();
QgsApplication::setPrefixPath(getQgisPath(), TRUE);
#ifdef Q_OS_LINUX
// QgsApplication::setPkgDataPath(qgisPath + "/../share/qgis");
// QgsApplication::setPluginPath(qgisPath + "/../lib/qgis");
#endif
QString qgisPath = QCoreApplication::applicationDirPath ();
QgsApplication::setPrefixPath(INSTALL_PREFIX, true);
QgsApplication::showSettings();
// Instantiate the plugin directory so that providers are loaded
QgsProviderRegistry::instance(QgsApplication::pluginPath());
//create some objects that will be used in all tests...
std::cout << "Prefix PATH: " << QgsApplication::prefixPath().toLocal8Bit().data() << std::endl;
std::cout << "Plugin PATH: " << QgsApplication::pluginPath().toLocal8Bit().data() << std::endl;
std::cout << "PkgData PATH: " << QgsApplication::pkgDataPath().toLocal8Bit().data() << std::endl;
std::cout << "User DB PATH: " << QgsApplication::qgisUserDbFilePath().toLocal8Bit().data() << std::endl;
//
//create a point layer that will be used in all tests...
//