Changed: #1159 plugin and resource handling

This commit is contained in:
rti 2010-12-12 21:56:56 +01:00
parent c3dddf8147
commit 8bdd015304
5 changed files with 19 additions and 7 deletions

View file

@ -127,8 +127,6 @@ void CPluginManager::readPluginPaths()
const QDir dir(searchPaths.takeFirst()); const QDir dir(searchPaths.takeFirst());
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
const QFileInfoList files = dir.entryInfoList(QStringList() << QString("*.dll"), QDir::Files); const QFileInfoList files = dir.entryInfoList(QStringList() << QString("*.dll"), QDir::Files);
#elif defined(Q_OS_MAC)
const QFileInfoList files = dir.entryInfoList(QStringList() << QString("*.dylib"), QDir::Files);
#else #else
const QFileInfoList files = dir.entryInfoList(QStringList() << QString("*.so"), QDir::Files); const QFileInfoList files = dir.entryInfoList(QStringList() << QString("*.so"), QDir::Files);
#endif #endif

View file

@ -3,6 +3,7 @@
#include <nel/misc/app_context.h> #include <nel/misc/app_context.h>
// Qt includes // Qt includes
#include <QtCore/QDir>
#include <QtGui/QMessageBox> #include <QtGui/QMessageBox>
#include <QtGui/QApplication> #include <QtGui/QApplication>
#include <QtGui/QSplashScreen> #include <QtGui/QSplashScreen>
@ -11,6 +12,7 @@
#include <nel/misc/debug.h> #include <nel/misc/debug.h>
#include <nel/misc/common.h> #include <nel/misc/common.h>
#include <nel/misc/file.h> #include <nel/misc/file.h>
#include <nel/misc/dynloadlib.h>
#include <nel/misc/path.h> #include <nel/misc/path.h>
#include <nel/misc/command.h> #include <nel/misc/command.h>
@ -91,6 +93,12 @@ sint main(int argc, char **argv)
splash->setPixmap(QPixmap(":/images/nel_ide_load.png")); splash->setPixmap(QPixmap(":/images/nel_ide_load.png"));
splash->show(); splash->show();
#if defined(NL_OS_MAC)
QDir::setCurrent(qApp->applicationDirPath() + QString("/../Resources"));
CLibrary::addLibPath(
(qApp->applicationDirPath() + QString("/../PlugIns/nel")).toStdString());
#endif
Modules::init(); Modules::init();
// load and set remap extensions from config // load and set remap extensions from config
@ -101,7 +109,13 @@ sint main(int argc, char **argv)
Modules::mainWin().showMaximized(); Modules::mainWin().showMaximized();
Modules::plugMan().addObject(&Modules::mainWin()); Modules::plugMan().addObject(&Modules::mainWin());
#if !defined(NL_OS_MAC)
Modules::plugMan().setPluginPaths(QStringList() << QString("./plugins")); Modules::plugMan().setPluginPaths(QStringList() << QString("./plugins"));
#else
Modules::plugMan().setPluginPaths(QStringList() <<
qApp->applicationDirPath() + QString("/../PlugIns/ovqt"));
#endif
Modules::plugMan().loadPlugins(); Modules::plugMan().loadPlugins();
QStringList errors; QStringList errors;

View file

@ -19,7 +19,7 @@ SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_EXAMPLE_MOC_SRC})
SOURCE_GROUP("Example Plugin" FILES ${SRC}) SOURCE_GROUP("Example Plugin" FILES ${SRC})
SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC})
ADD_LIBRARY(ovqt_plugin_example SHARED ${SRC} ${OVQT_PLUG_EXAMPLE_MOC_SRC} ${OVQT_EXT_SYS_SRC}) ADD_LIBRARY(ovqt_plugin_example MODULE ${SRC} ${OVQT_PLUG_EXAMPLE_MOC_SRC} ${OVQT_EXT_SYS_SRC})
TARGET_LINK_LIBRARIES(ovqt_plugin_example nelmisc ${QT_LIBRARIES}) TARGET_LINK_LIBRARIES(ovqt_plugin_example nelmisc ${QT_LIBRARIES})

View file

@ -9,7 +9,7 @@ SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin.
${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_spec.h) ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_spec.h)
SET(OVQT_PLUG_LOG_HDR log_plugin.h) SET(OVQT_PLUG_LOG_HDR log_plugin.h)
SET(OVQT_PLUG_LOG_UIS log_form.ui) SET(OVQT_PLUG_LOG_UIS log_form.ui)
SET(QT_USE_QTGUI TRUE) SET(QT_USE_QTGUI TRUE)
SET(QT_USE_QTOPENGL TRUE) SET(QT_USE_QTOPENGL TRUE)
@ -17,13 +17,13 @@ SET(QT_USE_QTOPENGL TRUE)
QT4_WRAP_CPP(OVQT_PLUG_LOG_MOC_SRC ${OVQT_PLUG_LOG_HDR}) QT4_WRAP_CPP(OVQT_PLUG_LOG_MOC_SRC ${OVQT_PLUG_LOG_HDR})
QT4_WRAP_UI( OVQT_PLUG_LOG_UI_HDRS ${OVQT_PLUG_LOG_UIS} ) QT4_WRAP_UI( OVQT_PLUG_LOG_UI_HDRS ${OVQT_PLUG_LOG_UIS} )
SOURCE_GROUP(QtResources FILES ${OVQT_PLUG_LOG_UIS}) SOURCE_GROUP(QtResources FILES ${OVQT_PLUG_LOG_UIS})
SOURCE_GROUP(QtGeneratedUiHdr FILES ${OVQT_PLUG_LOG_UI_HDRS}) SOURCE_GROUP(QtGeneratedUiHdr FILES ${OVQT_PLUG_LOG_UI_HDRS})
SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_LOG_MOC_SRC}) SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_LOG_MOC_SRC})
SOURCE_GROUP("Log Plugin" FILES ${SRC}) SOURCE_GROUP("Log Plugin" FILES ${SRC})
SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC})
ADD_LIBRARY(ovqt_plugin_log SHARED ${SRC} ${OVQT_PLUG_LOG_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_LOG_UI_HDRS}) ADD_LIBRARY(ovqt_plugin_log MODULE ${SRC} ${OVQT_PLUG_LOG_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_LOG_UI_HDRS})
TARGET_LINK_LIBRARIES(ovqt_plugin_log nelmisc ${QT_LIBRARIES}) TARGET_LINK_LIBRARIES(ovqt_plugin_log nelmisc ${QT_LIBRARIES})

View file

@ -19,7 +19,7 @@ SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_SHEET_BUILDER_MOC_SRC})
SOURCE_GROUP("Sheet builder Plugin" FILES ${SRC}) SOURCE_GROUP("Sheet builder Plugin" FILES ${SRC})
SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC})
ADD_LIBRARY(ovqt_plugin_sheet_builder SHARED ${SRC} ${OVQT_PLUG_SHEET_BUILDER_MOC_SRC} ${OVQT_EXT_SYS_SRC}) ADD_LIBRARY(ovqt_plugin_sheet_builder MODULE ${SRC} ${OVQT_PLUG_SHEET_BUILDER_MOC_SRC} ${OVQT_EXT_SYS_SRC})
TARGET_LINK_LIBRARIES(ovqt_plugin_sheet_builder nelmisc ${QT_LIBRARIES}) TARGET_LINK_LIBRARIES(ovqt_plugin_sheet_builder nelmisc ${QT_LIBRARIES})