Add the data directory to the search path.

This commit is contained in:
dfighter1985 2015-02-11 20:42:31 +01:00
parent a6ebf62e40
commit f76650bb21
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)
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_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/QFileDialog>
#if !defined NL_OS_WINDOWS
#include "core_config.h"
#endif
namespace Core
{
@ -118,6 +122,10 @@ void SearchPathsSettingsPage::applySearchPaths()
for (int i = 1; i < remapExt.size(); i += 2)
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)
{
NLMISC::CPath::addSearchPath(path.toUtf8().constData(), m_recurse, false);
@ -216,4 +224,4 @@ void SearchPathsSettingsPage::checkEnabledButton()
m_ui.downToolButton->setEnabled(bEnabled);
}
} /* namespace Core */
} /* namespace Core */