@@ -46,7 +46,6 @@ class TestQgsQuickPrint: public QObject
4646 void cleanup (){};// will be called after every testfunction.
4747
4848 void basicMapTest ();
49- QString getQgisPath (); // Gets the path to QGIS installation
5049 private:
5150 bool imageCheck (QString theType); // as above
5251 QgsMapRender * mpMapRenderer;
@@ -57,35 +56,18 @@ class TestQgsQuickPrint: public QObject
5756 QString mReport ;
5857};
5958
60- QString TestQgsQuickPrint::getQgisPath ()
61- {
62- #ifdef Q_OS_LINUX
63- QString qgisPath = QCoreApplication::applicationDirPath () + " /../" ;
64- #else // mac and win
65- QString qgisPath = QCoreApplication::applicationDirPath () ;
66- #endif
67- return qgisPath;
68- }
69-
7059void TestQgsQuickPrint::initTestCase ()
7160{
61+ //
62+ // Runs once before any tests are run
63+ //
7264 // init QGIS's paths - true means that all path will be inited from prefix
73- // QString qgisPath = QCoreApplication::applicationDirPath ();
74- QgsApplication::setPrefixPath (getQgisPath (), TRUE );
75- #ifdef Q_OS_LINUX
76- // QgsApplication::setPkgDataPath(qgisPath + "/../share/qgis");
77- // QgsApplication::setPluginPath(qgisPath + "/../lib/qgis");
78- #endif
65+ QString qgisPath = QCoreApplication::applicationDirPath ();
66+ QgsApplication::setPrefixPath (INSTALL_PREFIX, true );
67+ QgsApplication::showSettings ();
7968 // Instantiate the plugin directory so that providers are loaded
8069 QgsProviderRegistry::instance (QgsApplication::pluginPath ());
8170
82- // create some objects that will be used in all tests...
83-
84- std::cout << " Prefix PATH: " << QgsApplication::prefixPath ().toLocal8Bit ().data () << std::endl;
85- std::cout << " Plugin PATH: " << QgsApplication::pluginPath ().toLocal8Bit ().data () << std::endl;
86- std::cout << " PkgData PATH: " << QgsApplication::pkgDataPath ().toLocal8Bit ().data () << std::endl;
87- std::cout << " User DB PATH: " << QgsApplication::qgisUserDbFilePath ().toLocal8Bit ().data () << std::endl;
88-
8971 //
9072 // create a point layer that will be used in all tests...
9173 //
0 commit comments