Skip to content

Commit 85b4a36

Browse files
committedSep 7, 2012
Added comment about origin of qgis path var
1 parent 26dc406 commit 85b4a36

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed
 

‎tests/src/python/utilities.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,25 @@ def getQgisTestApp():
6767

6868
if QGISAPP is None:
6969
myGuiFlag = True # All test will run qgis in gui mode
70-
7170
QGISAPP = QgsApplication(sys.argv, myGuiFlag)
71+
# Note: QGIS_PREFIX_PATH is set by cmake to the output dir
72+
if 'QGIS_PREFIX_PATH' in os.environ:
73+
myPath = os.environ['QGIS_PREFIX_PATH']
74+
myUseDefaultPathFlag = True
75+
QGISAPP.setPrefixPath(myPath, myUseDefaultPathFlag)
76+
77+
if sys.platform.startswith('darwin'):
78+
# override resource paths, otherwise looks for Resources in app
79+
if 'QGIS_MAC_PKGDATA_DIR' in os.environ:
80+
myPkgPath = os.environ['QGIS_MAC_PKGDATA_DIR']
81+
QGISAPP.setPkgDataPath(myPkgPath)
82+
if 'QGIS_MAC_SVG_DIR' in os.environ:
83+
mySVGPath = os.environ['QGIS_MAC_SVG_DIR']
84+
mySVGPaths = QGISAPP.svgPaths()
85+
# doesn't get rid of incorrect path, just adds correct one
86+
mySVGPaths.prepend(mySVGPath)
87+
QGISAPP.setDefaultSvgPaths(mySVGPaths)
88+
7289
QGISAPP.initQgis()
7390
s = QGISAPP.showSettings()
7491
print s

0 commit comments

Comments
 (0)
Please sign in to comment.