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

This commit is contained in:
dfighter1985 2015-02-09 01:48:39 +01:00
parent e26561ae1d
commit 33d658a444
5 changed files with 18 additions and 3 deletions

View file

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

View file

@ -4,6 +4,8 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}
${QT_INCLUDES} ${QT_INCLUDES}
${LUA_INCLUDE_DIR}) ${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) FILE(GLOB SRC *.cpp *.h)
SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin.h SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin.h

View file

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

View file

@ -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

View file

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