From 8c47b39535a4d92fda9db48c298e8c2abbb1eec2 Mon Sep 17 00:00:00 2001 From: LibrePilot Packager Date: Sun, 12 Jul 2015 00:18:25 +0100 Subject: [PATCH] use GetDataPath instead of hardcoding --- .../openpilotgcs/src/plugins/coreplugin/coreimpl.cpp | 10 +++------- .../plugins/modelview/modelviewgadgetconfiguration.cpp | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/coreplugin/coreimpl.cpp b/ground/openpilotgcs/src/plugins/coreplugin/coreimpl.cpp index 5ee027096..a6e3ab31d 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/coreimpl.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/coreimpl.cpp @@ -31,6 +31,8 @@ #include #include +#include "utils/pathutils.h" + namespace Core { namespace Internal { // The Core Singleton @@ -125,15 +127,9 @@ SettingsDatabase *CoreImpl::settingsDatabase() const return m_mainwindow->settingsDatabase(); } -#ifdef Q_OS_MAC -# define SHARE_PATH "/../Resources" -#else -# define SHARE_PATH "/../share/openpilotgcs" -#endif - QString CoreImpl::resourcePath() const { - return QDir::cleanPath(QCoreApplication::applicationDirPath() + QLatin1String(SHARE_PATH)); + return QDir::cleanPath(Utils::GetDataPath()); } IContext *CoreImpl::currentContextObject() const diff --git a/ground/openpilotgcs/src/plugins/modelview/modelviewgadgetconfiguration.cpp b/ground/openpilotgcs/src/plugins/modelview/modelviewgadgetconfiguration.cpp index 71aa65ccb..7e2f550ff 100644 --- a/ground/openpilotgcs/src/plugins/modelview/modelviewgadgetconfiguration.cpp +++ b/ground/openpilotgcs/src/plugins/modelview/modelviewgadgetconfiguration.cpp @@ -30,7 +30,7 @@ ModelViewGadgetConfiguration::ModelViewGadgetConfiguration(QString classId, QSettings *qSettings, QObject *parent) : IUAVGadgetConfiguration(classId, parent), - m_acFilename("../share/openpilotgcs/models/planes/Easystar/EasyStar.3ds"), + m_acFilename(Utils::GetDataPath() + QString("models/planes/Easystar/EasyStar.3ds")), m_bgFilename(""), m_enableVbo(false) {