From 08aaad92ac3fe26a291077349a2cb73abbeb0759 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 8 Feb 2011 18:08:03 +0100 Subject: [PATCH] Maemo: Fix default deployment paths. Applications must live in /opt/ on Harmattan & Meego. Reviewed-by: Alessandro Portale --- .../qmlapplicationviewer/qmlapplicationviewer.cpp | 13 +++++++------ share/qtcreator/templates/shared/deployment.pri | 5 ++--- .../qt-maemo/maemodeployablelistmodel.cpp | 5 +---- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/share/qtcreator/templates/qtquickapp/qmlapplicationviewer/qmlapplicationviewer.cpp b/share/qtcreator/templates/qtquickapp/qmlapplicationviewer/qmlapplicationviewer.cpp index b0688a29fb7..9725f6fee7c 100644 --- a/share/qtcreator/templates/qtquickapp/qmlapplicationviewer/qmlapplicationviewer.cpp +++ b/share/qtcreator/templates/qtquickapp/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -58,12 +58,13 @@ QString QmlApplicationViewerPrivate::adjustPath(const QString &path) return QCoreApplication::applicationDirPath() + QLatin1String("/../Resources/") + path; #else - const QString pathInShareDir = QCoreApplication::applicationDirPath() - + QLatin1String("/../share/") - + QFileInfo(QCoreApplication::applicationFilePath()).fileName() - + QLatin1Char('/') + path; - if (QFileInfo(pathInShareDir).exists()) - return pathInShareDir; + const QString pathInInstallDir = QCoreApplication::applicationDirPath() + + QLatin1String("/../") + path; + if (pathInInstallDir.contains(QLatin1String("opt")) + && pathInInstallDir.contains(QLatin1String("bin")) + && QFileInfo(pathInInstallDir).exists()) { + return pathInInstallDir; + } #endif #endif return path; diff --git a/share/qtcreator/templates/shared/deployment.pri b/share/qtcreator/templates/shared/deployment.pri index 25af78746fb..7b06ed645f7 100644 --- a/share/qtcreator/templates/shared/deployment.pri +++ b/share/qtcreator/templates/shared/deployment.pri @@ -44,10 +44,8 @@ symbian { } } else:unix { maemo5 { - installPrefix = /opt/usr desktopfile.path = /usr/share/applications/hildon } else { - installPrefix = /usr desktopfile.path = /usr/share/applications copyCommand = for(deploymentfolder, DEPLOYMENTFOLDERS) { @@ -76,12 +74,13 @@ symbian { QMAKE_EXTRA_TARGETS += first copydeploymentfolders } } + installPrefix = /opt/$${TARGET} for(deploymentfolder, DEPLOYMENTFOLDERS) { item = item$${deploymentfolder} itemfiles = $${item}.files $$itemfiles = $$eval($${deploymentfolder}.source) itempath = $${item}.path - $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + $$itempath = $${installPrefix}/$$eval($${deploymentfolder}.target) export($$itemfiles) export($$itempath) INSTALLS += $$item diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp index 5e08834941b..59a5bbf687f 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp @@ -360,10 +360,7 @@ QString MaemoDeployableListModel::proFileScope() const QString MaemoDeployableListModel::installPrefix() const { - const QtVersion *const qv = qtVersion(); - QTC_ASSERT(qv, return QString()); - return QLatin1String(MaemoGlobal::version(qv) == MaemoGlobal::Maemo5 - ? "/opt/usr" : "/usr"); + return QLatin1String("/opt/") + m_projectName; } } // namespace Qt4ProjectManager