@@ -46,7 +46,6 @@ class TestQgsQuickPrint: public QObject
46
46
void cleanup (){};// will be called after every testfunction.
47
47
48
48
void basicMapTest ();
49
- QString getQgisPath (); // Gets the path to QGIS installation
50
49
private:
51
50
bool imageCheck (QString theType); // as above
52
51
QgsMapRender * mpMapRenderer;
@@ -57,35 +56,18 @@ class TestQgsQuickPrint: public QObject
57
56
QString mReport ;
58
57
};
59
58
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
-
70
59
void TestQgsQuickPrint::initTestCase ()
71
60
{
61
+ //
62
+ // Runs once before any tests are run
63
+ //
72
64
// 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 ();
79
68
// Instantiate the plugin directory so that providers are loaded
80
69
QgsProviderRegistry::instance (QgsApplication::pluginPath ());
81
70
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
-
89
71
//
90
72
// create a point layer that will be used in all tests...
91
73
//
0 commit comments