0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-24 16:44:39 +03:00

Loading designer plugin strategy has been changed

This commit is contained in:
Arin Alexander 2021-04-14 21:21:38 +03:00
parent e1d7d7b8ef
commit 5c7b40c0a0
3 changed files with 22 additions and 25 deletions

View File

@ -1,15 +1,7 @@
#BINARY_RESULT_DIR = $${TOP_BUILD_DIR}
isEmpty(BINARY_RESULT_DIR) { isEmpty(BINARY_RESULT_DIR) {
BINARY_RESULT_DIR = $${PWD} BINARY_RESULT_DIR = $${PWD}
} }
message(TOP_BUILD_DIR: $$TOP_BUILD_DIR)
#!contains(CONFIG, config_build_dir){
# TOP_BUILD_DIR = $${PWD}
#}
!contains(CONFIG, no_build_translations){ !contains(CONFIG, no_build_translations){
CONFIG += build_translations CONFIG += build_translations
} }
@ -64,6 +56,7 @@ contains(CONFIG, qtscriptengine){
!contains(CONFIG, no_embedded_designer){ !contains(CONFIG, no_embedded_designer){
CONFIG *= embedded_designer CONFIG *= embedded_designer
DEFINES += HAVE_REPORT_DESIGNER DEFINES += HAVE_REPORT_DESIGNER
message(embedded designer)
} }
ZINT_PATH = $$PWD/3rdparty/zint-2.6.1 ZINT_PATH = $$PWD/3rdparty/zint-2.6.1
@ -133,7 +126,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc
LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MAJOR = 1
LIMEREPORT_VERSION_MINOR = 5 LIMEREPORT_VERSION_MINOR = 5
LIMEREPORT_VERSION_RELEASE = 84 LIMEREPORT_VERSION_RELEASE = 85
LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}'
DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\"

View File

@ -2,6 +2,7 @@ include(../common.pri)
contains(CONFIG, embedded_designer){ contains(CONFIG, embedded_designer){
include(designer.pri) include(designer.pri)
message(embedded designer)
} }
DEFINES += INSPECT_BASEDESIGN DEFINES += INSPECT_BASEDESIGN

View File

@ -110,25 +110,28 @@ ReportEnginePrivate::ReportEnginePrivate(QObject *parent) :
connect(m_datasources,SIGNAL(loadCollectionFinished(QString)),this,SLOT(slotDataSourceCollectionLoaded(QString))); connect(m_datasources,SIGNAL(loadCollectionFinished(QString)),this,SLOT(slotDataSourceCollectionLoaded(QString)));
connect(m_fileWatcher,SIGNAL(fileChanged(const QString &)),this,SLOT(slotLoadFromFile(const QString &))); connect(m_fileWatcher,SIGNAL(fileChanged(const QString &)),this,SLOT(slotLoadFromFile(const QString &)));
#ifndef HAVE_REPORT_DESIGNER
QDir pluginsDir = QCoreApplication::applicationDirPath(); QDir pluginsDir = QCoreApplication::applicationDirPath();
pluginsDir.cd("../lib" ); if (!pluginsDir.cd("../lib" )){
if (!pluginsDir.exists()){
pluginsDir.cd("./lib"); pluginsDir.cd("./lib");
if (!pluginsDir.exists()) pluginsDir.setPath(QCoreApplication::applicationDirPath());
} }
if (pluginsDir != QCoreApplication::applicationDirPath()){
foreach( const QString& pluginName, pluginsDir.entryList( QDir::Files ) ) { foreach( const QString& pluginName, pluginsDir.entryList( QDir::Files ) ) {
QPluginLoader loader( pluginsDir.absoluteFilePath( pluginName ) ); QPluginLoader loader( pluginsDir.absoluteFilePath( pluginName ) );
if( loader.load() ) { if( loader.load() ) {
#ifndef HAVE_REPORT_DESIGNER
if( LimeReportDesignerPluginInterface* designerPlugin = qobject_cast< LimeReportDesignerPluginInterface* >( loader.instance() ) ) { if( LimeReportDesignerPluginInterface* designerPlugin = qobject_cast< LimeReportDesignerPluginInterface* >( loader.instance() ) ) {
m_designerFactory = designerPlugin; m_designerFactory = designerPlugin;
break; break;
} }
#endif
}
} }
} }
#endif
} }
ReportEnginePrivate::~ReportEnginePrivate() ReportEnginePrivate::~ReportEnginePrivate()