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;
 
   92   const auto constPluginList( 
sPythonUtils->pluginList() );
 
   93   for ( 
const QString &pluginName : constPluginList )
 
   95     QString pluginService = 
sPythonUtils->getPluginMetadata( pluginName, QStringLiteral( 
"server" ) );
 
   96     if ( pluginService == QLatin1String( 
"True" ) )
 
  102           atLeastOneEnabled = 
true;
 
static int versionInt()
Version number used for comparing versions using the "Check QGIS Version" function.
static QString libraryPath()
Returns the path containing qgis_core, qgis_gui, qgispython (and other) libraries.
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins.
static QStringList & serverPlugins()
List of available server plugin names.
static QgsPythonUtils * sPythonUtils
Pointer to QgsPythonUtils.
static bool initPlugins(QgsServerInterface *interface)
Initializes the Python plugins.