From 9799579a89e6a0418ae14e8a4783b0e9c5eb7ccb Mon Sep 17 00:00:00 2001 From: Gaudenz Steinlin Date: Thu, 22 Dec 2016 07:55:05 +0000 Subject: [PATCH] fix-help-data-dir Gbp-Pq: Name fix-help-data-dir.patch --- src/mapper_config.h.in | 2 ++ src/mapper_resource.cpp | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/mapper_config.h.in b/src/mapper_config.h.in index 9f3ff3e..4c78d73 100644 --- a/src/mapper_config.h.in +++ b/src/mapper_config.h.in @@ -26,6 +26,8 @@ #define APP_NAME qApp->translate("Global", QT_TRANSLATE_NOOP("Global", "OpenOrienteering Mapper")) #define APP_VERSION "@Mapper_VERSION_DISPLAY@" #define MAPPER_HELP_NAMESPACE "@Mapper_HELP_NAMESPACE@" +#define MAPPER_DATA_DESTINATION "@MAPPER_DATA_DESTINATION@" +#define MAPPER_LIBRARY_DESTINATION "@MAPPER_LIBRARY_DESTINATION@" #cmakedefine Mapper_BUILD_PROJ #cmakedefine Mapper_TRANSLATIONS_EMBEDDED diff --git a/src/mapper_resource.cpp b/src/mapper_resource.cpp index c7e9d0c..7e97c9c 100644 --- a/src/mapper_resource.cpp +++ b/src/mapper_resource.cpp @@ -122,8 +122,8 @@ QStringList MapperResource::getLocations(MapperResource::RESOURCE_TYPE resource_ #endif #if defined(MAPPER_PACKAGE_NAME) - // Linux: program in xxx/bin, resources in xxx/bin/../share/PACKAGE_NAME - QString linux_dir(app_dir.absoluteFilePath(QLatin1String("../share/") + QString::fromUtf8(MAPPER_PACKAGE_NAME) + resource_path)); + // Linux: resources in MAPPER_DATA_DESTINATION + QString linux_dir(app_dir.absoluteFilePath(QString::fromUtf8(MAPPER_DATA_DESTINATION) + resource_path)); addIfExists(locations, linux_dir); #endif @@ -175,8 +175,9 @@ QStringList MapperResource::getProgramLocations(MapperResource::RESOURCE_TYPE re QDir app_dir(QCoreApplication::applicationDirPath()); #if defined(Mapper_PACKAGE_ASSISTANT) and defined(MAPPER_PACKAGE_NAME) - // Linux: extra binaries in xxx/bin/../share/PACKAGE_NAME/bin - addIfExists(locations, app_dir.absoluteFilePath(QLatin1String("../lib/") + QString::fromUtf8(MAPPER_PACKAGE_NAME) + QLatin1String("/bin/") + program_name)); + // Linux: extra binaries in MAPPER_LIBRARY_DESTINATION/bin + addIfExists(locations, app_dir.absoluteFilePath(QString::fromUtf8(MAPPER_LIBRARY_DESTINATION) + QLatin1String("/bin/") + program_name)); + #endif // Find the program which is in the same directory as Mapper -- 2.30.2