Fix for sensor plugin in TelldusCenter in Linux. This closes #181 kind of.

This commit is contained in:
Stefan Persson 2013-09-11 14:05:56 +02:00
parent 979bee6174
commit d1e33dff0c
2 changed files with 11 additions and 0 deletions

View file

@ -2,6 +2,9 @@ SET(QT_USE_QTDECLARATIVE TRUE)
SET( Plugin_NAME "QMLLoader" )
if(COMMAND cmake_policy)
cmake_policy(SET CMP0005 NEW)
endif(COMMAND cmake_policy)
SET( Plugin_SRCS
scriptfunctionwrapper.cpp
@ -30,5 +33,6 @@ ELSEIF (APPLE)
SET(QT_COMPONENTS_OUTPUT_DIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/TelldusCenter.app/Contents/Plugins/declarative")
ELSE()
SET(QT_COMPONENTS_OUTPUT_DIR "${CMAKE_BINARY_DIR}/TelldusCenter/Plugins/declarative")
ADD_DEFINITIONS( -DPLUGIN_LIB_PATH=${CMAKE_INSTALL_PREFIX}/${PLUGIN_LIB_FULL_PATH}/declarative )
ENDIF()
INCLUDE( ${CMAKE_SOURCE_DIR}/3rdparty/qt-components-desktop.cmake NO_POLICY_SCOPE )

View file

@ -6,6 +6,9 @@
#include <QVariant>
#include <QApplication>
#define DEFINE_STRING_HELPER(X) #X
#define DEFINE_STRING(X) DEFINE_STRING_HELPER(X)
class QMLView::PrivateData {
public:
QDir baseDir;
@ -32,6 +35,10 @@ QMLView::QMLView(const QDir &dir, const QScriptValue &object) :
paths << pluginsDir.absolutePath();
}
#if defined(Q_OS_UNIX)
paths << DEFINE_STRING(PLUGIN_LIB_PATH);
#endif
eng->setImportPathList(paths);
d = new PrivateData;