Skip to content

Commit

Permalink
Added comment about origin of qgis path var
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux committed Sep 7, 2012
1 parent 26dc406 commit 85b4a36
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tests/src/python/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,25 @@ def getQgisTestApp():

if QGISAPP is None:
myGuiFlag = True # All test will run qgis in gui mode

QGISAPP = QgsApplication(sys.argv, myGuiFlag)
# Note: QGIS_PREFIX_PATH is set by cmake to the output dir
if 'QGIS_PREFIX_PATH' in os.environ:
myPath = os.environ['QGIS_PREFIX_PATH']
myUseDefaultPathFlag = True
QGISAPP.setPrefixPath(myPath, myUseDefaultPathFlag)

if sys.platform.startswith('darwin'):
# override resource paths, otherwise looks for Resources in app
if 'QGIS_MAC_PKGDATA_DIR' in os.environ:
myPkgPath = os.environ['QGIS_MAC_PKGDATA_DIR']
QGISAPP.setPkgDataPath(myPkgPath)
if 'QGIS_MAC_SVG_DIR' in os.environ:
mySVGPath = os.environ['QGIS_MAC_SVG_DIR']
mySVGPaths = QGISAPP.svgPaths()
# doesn't get rid of incorrect path, just adds correct one
mySVGPaths.prepend(mySVGPath)
QGISAPP.setDefaultSvgPaths(mySVGPaths)

QGISAPP.initQgis()
s = QGISAPP.showSettings()
print s
Expand Down

0 comments on commit 85b4a36

Please sign in to comment.