22 #include "qgspythonutils.h"
33 static QStringList *pluginList =
new QStringList();
41 QString pythonlibName( QStringLiteral(
"qgispython" ) );
42 #if defined(Q_OS_UNIX)
46 pythonlibName.prepend(
"lib" );
50 QLibrary pythonlib( pythonlibName, version );
53 pythonlib.setLoadHints( QLibrary::ResolveAllSymbolsHint | QLibrary::ExportExternalSymbolsHint );
54 if ( !pythonlib.load() )
56 pythonlib.setFileName( pythonlibName );
57 if ( !pythonlib.load() )
65 typedef QgsPythonUtils*( *inst )();
66 inst pythonlib_inst = ( inst )
cast_to_fptr( pythonlib.resolve(
"instance" ) );
67 if ( !pythonlib_inst )
70 QgsDebugMsg( QStringLiteral(
"Couldn't resolve python support library's instance() symbol." ) );
74 QgsDebugMsg( QStringLiteral(
"Python support library's instance() symbol resolved." ) );
80 QgsDebugMsg( QStringLiteral(
"Python support ENABLED :-)" ) );
84 QgsDebugMsg( QStringLiteral(
"Python support FAILED :-(" ) );
90 bool atLeastOneEnabled =
false;
91 for (
const QString &pluginName :
sPythonUtils->pluginList() )
93 QString pluginService =
sPythonUtils->getPluginMetadata( pluginName, QStringLiteral(
"server" ) );
94 if ( pluginService == QLatin1String(
"True" ) )
100 atLeastOneEnabled =
true;