Search schemaExtension.xsd in share directory

This commit is contained in:
Blottiere Paul 2017-09-29 16:25:10 +01:00
parent b80bfa8f9e
commit a9a2c200e3
5 changed files with 25 additions and 2 deletions

View File

@ -210,6 +210,12 @@ Returns the path to the donors file.
:rtype: str
%End
static QString serverResourcesPath();
%Docstring
Returns the path to the server resources directory.
:rtype: str
%End
static QString translatorsFilePath();
%Docstring
Returns the path to the sponsors file.

View File

@ -846,6 +846,11 @@ QString QgsApplication::defaultThemesFolder()
return ABISYM( mPkgDataPath ) + QStringLiteral( "/resources/themes" );
}
QString QgsApplication::serverResourcesPath()
{
return ABISYM( mPkgDataPath ) + QStringLiteral( "/resources/server/" );
}
QString QgsApplication::libraryPath()
{
return ABISYM( mLibraryPath );

View File

@ -231,6 +231,9 @@ class CORE_EXPORT QgsApplication : public QApplication
//! Returns the path to the donors file.
static QString donorsFilePath();
//! Returns the path to the server resources directory.
static QString serverResourcesPath();
/**
* Returns the path to the sponsors file.
*/

View File

@ -46,8 +46,8 @@ namespace QgsWms
QDomDocument xsdDoc;
QDir fcgiBinDir = QFileInfo( QCoreApplication::applicationFilePath() ).absoluteDir();
QFileInfo xsdFileInfo( fcgiBinDir, QStringLiteral( "schemaExtension.xsd" ) );
QDir resourcesDir = QFileInfo( QgsApplication::serverResourcesPath() ).absoluteDir();
QFileInfo xsdFileInfo( resourcesDir, QStringLiteral( "schemaExtension.xsd" ) );
if ( !xsdFileInfo.exists() )
{

View File

@ -0,0 +1,9 @@
*****
Content-Type: text/xml; charset=utf-8
<?xml version='1.0' encoding='UTF-8'?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.qgis.org/wms" elementFormDefault="qualified" version="1.0.0">
<import xmlns="http://www.w3.org/2001/XMLSchema" namespace="http://www.opengis.net/wms" schemaLocation="http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd"/>
<element xmlns="http://www.w3.org/2001/XMLSchema" name="GetPrint" substitutionGroup="wms:_ExtendedOperation" type="wms:OperationType"/>
<element xmlns="http://www.w3.org/2001/XMLSchema" name="GetStyles" substitutionGroup="wms:_ExtendedOperation" type="wms:OperationType"/>
</schema>