Read the GUI Editor widget and expression definition XML files from the right directory.

--HG--
branch : hotfix
hg/compatibility
dfighter1985 10 years ago
parent a2c96c3053
commit b881f9558b

@ -10,15 +10,18 @@ IF(WIN32)
SET(OVQT_PLUGIN_SPECS_DIR "plugins")
SET(OVQT_PLUGIN_DIR "plugins")
SET(OVQT_DATA_DIR ".")
SET(OVQT_IMP_DATA_DIR "${OVQT_DATA_DIR}")
ELSEIF(APPLE)
# TODO: under Mac OS X, don't install but copy files in application package
SET(OVQT_PLUGIN_SPECS_DIR "plugins")
SET(OVQT_PLUGIN_DIR "plugins")
SET(OVQT_DATA_DIR ".")
SET(OVQT_IMP_DATA_DIR "${OVQT_DATA_DIR}")
ELSE(WIN32)
SET(OVQT_PLUGIN_SPECS_DIR ${NL_SHARE_PREFIX}/studio/plugins)
SET(OVQT_PLUGIN_DIR ${NL_LIB_PREFIX}/studio)
SET(OVQT_DATA_DIR ${NL_SHARE_PREFIX}/studio/data)
SET(OVQT_IMP_DATA_DIR "${CMAKE_INSTALL_PREFIX}/${OVQT_DATA_DIR}")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/ovqt_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/ovqt_config.h)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})

@ -4,6 +4,8 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}
${QT_INCLUDES}
${LUA_INCLUDE_DIR})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/gui_editor_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/gui_editor_config.h)
FILE(GLOB SRC *.cpp *.h)
SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin.h

@ -21,6 +21,7 @@
#include "expression_loader.h"
#include <QMap>
#include <QDir>
#include "gui_editor_config.h"
class ExpressionStorePvt
{
@ -50,7 +51,7 @@ ExpressionStore::~ExpressionStore()
bool ExpressionStore::load()
{
QDir d( "expressions" );
QDir d( EXPRESSIONS_DIR );
if( !d.exists() )
return false;

@ -0,0 +1,8 @@
#ifndef GUI_EDITOR_CONFIG_H
#define GUI_EDITOR_CONFIG_H
#define WIDGETS_DIR "${OVQT_IMP_DATA_DIR}/widgets"
#define EXPRESSIONS_DIR "${OVQT_IMP_DATA_DIR}/expressions"
#endif

@ -20,6 +20,7 @@
#include <QStringList>
#include "nel/misc/debug.h"
#include "widget_info_tree.h"
#include "gui_editor_config.h"
using namespace NLMISC;
@ -36,7 +37,7 @@ namespace GUIEditor
void CWidgetPropParser::parseGUIWidgets()
{
QDir d( "widgets" );
QDir d( WIDGETS_DIR );
if( !d.exists() )
{
nlwarning( "GUI widgets directory doesn't exist!" );
@ -55,7 +56,7 @@ namespace GUIEditor
QStringListIterator itr( files );
while( itr.hasNext() )
parseGUIWidget( "widgets/" + itr.next() );
parseGUIWidget( QString( WIDGETS_DIR ) + QString( "/" ) + itr.next() );
buildWidgetInfoTree();

Loading…
Cancel
Save