Load QML from the right path when installed
authorIvan Frade <ivan.frade@gmail.com>
Tue, 5 Jul 2011 13:18:41 +0000 (16:18 +0300)
committerIvan Frade <ivan.frade@gmail.com>
Tue, 5 Jul 2011 13:18:41 +0000 (16:18 +0300)
src/mussorgsky-qml.py

index a73bdf1..ce4c5db 100755 (executable)
@@ -2,6 +2,7 @@
 # -*- coding: utf-8 -*-
  
 import sys
+import os
 from PySide.QtCore import *
 from PySide.QtGui import *
 from PySide.QtDeclarative import QDeclarativeView
@@ -32,7 +33,10 @@ rc.setContextProperty ('missionControl', controller)
 
 # Create an URL to the QML file
 #url = QUrl('view.qml')
-url = QUrl ("../ui/main.qml")
+if os.path.exists ("../ui/main.qml"):
+    url = QUrl ("../ui/main.qml")
+else:
+    url = QUrl ("/usr/lib/mussorgsky/qml/main.qml")
 # Set the QML file and show
 view.setSource(url)
 view.engine().quit.connect (app.quit)