diff options
author | Eike Ziller <eike.ziller@qt.io> | 2016-11-02 11:51:19 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2016-12-01 14:24:53 +0000 |
commit | 36b443dfba3c5cb29b343249810d4513b66fa4b3 (patch) | |
tree | 979b6c7b1411841264952e87857824bc2643a7b6 /src/plugins/coreplugin/icore.cpp | |
parent | b3a9031b9fd97907fdad2c36e5a78c531607ac4e (diff) |
Add defines for relative data paths
Derive the relative paths used in code from the paths used by the build
system.
Change-Id: I208ee55d3c1ee76921734f5c1c6c40d3fcb9724c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/coreplugin/icore.cpp')
-rw-r--r-- | src/plugins/coreplugin/icore.cpp | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index ee810e5756..2790075638 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -402,9 +402,7 @@ QString ICore::userInterfaceLanguage() QString ICore::resourcePath() { - const QString sharePath = QLatin1String(Utils::HostOsInfo::isMacHost() - ? "/../Resources" : "/../share/qtcreator"); - return QDir::cleanPath(QCoreApplication::applicationDirPath() + sharePath); + return QDir::cleanPath(QCoreApplication::applicationDirPath() + '/' + RELATIVE_DATA_PATH); } QString ICore::userResourcePath() @@ -424,9 +422,7 @@ QString ICore::userResourcePath() QString ICore::documentationPath() { - const QString docPath = QLatin1String(Utils::HostOsInfo::isMacHost() - ? "/../Resources/doc" : "/../share/doc/qtcreator"); - return QDir::cleanPath(QCoreApplication::applicationDirPath() + docPath); + return QDir::cleanPath(QCoreApplication::applicationDirPath() + '/' + RELATIVE_DOC_PATH); } /*! @@ -435,21 +431,7 @@ QString ICore::documentationPath() */ QString ICore::libexecPath() { - QString path; - switch (Utils::HostOsInfo::hostOs()) { - case Utils::OsTypeWindows: - path = QCoreApplication::applicationDirPath(); - break; - case Utils::OsTypeMac: - path = QCoreApplication::applicationDirPath() + QLatin1String("/../Resources"); - break; - case Utils::OsTypeLinux: - case Utils::OsTypeOtherUnix: - case Utils::OsTypeOther: - path = QCoreApplication::applicationDirPath() + QLatin1String("/../libexec/qtcreator"); - break; - } - return QDir::cleanPath(path); + return QDir::cleanPath(QApplication::applicationDirPath() + '/' + RELATIVE_LIBEXEC_PATH); } static QString compilerString() |