Skip to content
Snippets Groups Projects
Commit 68f13d3f authored by Christian Kandeler's avatar Christian Kandeler
Browse files

QML Wizard: Let executable find its QML files on Linux.

Reviewed-by: dt
parent aef9d15e
No related branches found
No related tags found
No related merge requests found
...@@ -23,10 +23,19 @@ class QmlApplicationViewerPrivate ...@@ -23,10 +23,19 @@ class QmlApplicationViewerPrivate
QString QmlApplicationViewerPrivate::adjustPath(const QString &path) QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
{ {
#ifdef Q_OS_UNIX
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
if (!QDir::isAbsolutePath(path)) if (!QDir::isAbsolutePath(path))
return QCoreApplication::applicationDirPath() return QCoreApplication::applicationDirPath()
+ QLatin1String("/../Resources/") + path; + QLatin1String("/../Resources/") + path;
#else
const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ QLatin1String("/../share/")
+ QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ QLatin1Char('/') + path;
if (QFileInfo(pathInShareDir).exists())
return pathInShareDir;
#endif
#endif #endif
return path; return path;
} }
......
...@@ -69,17 +69,18 @@ symbian { ...@@ -69,17 +69,18 @@ symbian {
QMAKE_EXTRA_TARGETS += first copydeploymentfolders QMAKE_EXTRA_TARGETS += first copydeploymentfolders
} }
} }
installPrefix = /opt
for(deploymentfolder, DEPLOYMENTFOLDERS) { for(deploymentfolder, DEPLOYMENTFOLDERS) {
item = item$${deploymentfolder} item = item$${deploymentfolder}
itemfiles = $${item}.files itemfiles = $${item}.files
$$itemfiles = $$eval($${deploymentfolder}.source) $$itemfiles = $$eval($${deploymentfolder}.source)
itempath = $${item}.path itempath = $${item}.path
$$itempath = /opt/share/$$eval($${deploymentfolder}.target) $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
INSTALLS += $$item INSTALLS += $$item
} }
icon.files = $${TARGET}.png icon.files = $${TARGET}.png
icon.path = /usr/share/icons/hicolor/64x64 icon.path = /usr/share/icons/hicolor/64x64
desktopfile.files = $${TARGET}.desktop desktopfile.files = $${TARGET}.desktop
target.path = /opt/bin target.path = $${installPrefix}/bin
INSTALLS += desktopfile icon target INSTALLS += desktopfile icon target
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment