Add the data directory to the search path.

--HG--
branch : hotfix
This commit is contained in:
dfighter1985 2015-02-11 20:42:31 +01:00
parent 26f1cc6fac
commit b381ef6fae
3 changed files with 20 additions and 1 deletions

View file

@ -38,6 +38,10 @@ SET(OVQT_CORE_PLUGIN_UIS settings_dialog.ui
SET(OVQT_CORE_PLUGIN_RCS core.qrc) SET(OVQT_CORE_PLUGIN_RCS core.qrc)
IF(NOT WIN32)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/core_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/core_config.h)
ENDIF(NOT WIN32)
SET(QT_USE_QTGUI TRUE) SET(QT_USE_QTGUI TRUE)
SET(QT_USE_QTOPENGL TRUE) SET(QT_USE_QTOPENGL TRUE)

View file

@ -0,0 +1,7 @@
#ifndef CORE_CONFIG_H
#define CORE_CONFIG_H
#define STUDIO_DATA_DIR "${OVQT_IMP_DATA_DIR}"
#endif

View file

@ -28,6 +28,10 @@
#include <QtGui/QWidget> #include <QtGui/QWidget>
#include <QtGui/QFileDialog> #include <QtGui/QFileDialog>
#if !defined NL_OS_WINDOWS
#include "core_config.h"
#endif
namespace Core namespace Core
{ {
@ -118,6 +122,10 @@ void SearchPathsSettingsPage::applySearchPaths()
for (int i = 1; i < remapExt.size(); i += 2) for (int i = 1; i < remapExt.size(); i += 2)
NLMISC::CPath::remapExtension(remapExt.at(i - 1).toUtf8().constData(), remapExt.at(i).toUtf8().constData(), true); NLMISC::CPath::remapExtension(remapExt.at(i - 1).toUtf8().constData(), remapExt.at(i).toUtf8().constData(), true);
#if !defined NL_OS_WINDOWS
NLMISC::CPath::addSearchPath(std::string(STUDIO_DATA_DIR), false, false);
#endif
Q_FOREACH(QString path, paths) Q_FOREACH(QString path, paths)
{ {
NLMISC::CPath::addSearchPath(path.toUtf8().constData(), m_recurse, false); NLMISC::CPath::addSearchPath(path.toUtf8().constData(), m_recurse, false);
@ -216,4 +224,4 @@ void SearchPathsSettingsPage::checkEnabledButton()
m_ui.downToolButton->setEnabled(bEnabled); m_ui.downToolButton->setEnabled(bEnabled);
} }
} /* namespace Core */ } /* namespace Core */