Skip to content

Commit a9a2c20

Browse files
committedOct 10, 2017
Search schemaExtension.xsd in share directory
1 parent b80bfa8 commit a9a2c20

File tree

5 files changed

+25
-2
lines changed

5 files changed

+25
-2
lines changed
 

‎python/core/qgsapplication.sip

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,12 @@ Returns the path to the donors file.
210210
:rtype: str
211211
%End
212212

213+
static QString serverResourcesPath();
214+
%Docstring
215+
Returns the path to the server resources directory.
216+
:rtype: str
217+
%End
218+
213219
static QString translatorsFilePath();
214220
%Docstring
215221
Returns the path to the sponsors file.

‎src/core/qgsapplication.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,11 @@ QString QgsApplication::defaultThemesFolder()
846846
return ABISYM( mPkgDataPath ) + QStringLiteral( "/resources/themes" );
847847
}
848848

849+
QString QgsApplication::serverResourcesPath()
850+
{
851+
return ABISYM( mPkgDataPath ) + QStringLiteral( "/resources/server/" );
852+
}
853+
849854
QString QgsApplication::libraryPath()
850855
{
851856
return ABISYM( mLibraryPath );

‎src/core/qgsapplication.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ class CORE_EXPORT QgsApplication : public QApplication
231231
//! Returns the path to the donors file.
232232
static QString donorsFilePath();
233233

234+
//! Returns the path to the server resources directory.
235+
static QString serverResourcesPath();
236+
234237
/**
235238
* Returns the path to the sponsors file.
236239
*/

‎src/server/services/wms/qgswmsgetschemaextension.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ namespace QgsWms
4646

4747
QDomDocument xsdDoc;
4848

49-
QDir fcgiBinDir = QFileInfo( QCoreApplication::applicationFilePath() ).absoluteDir();
50-
QFileInfo xsdFileInfo( fcgiBinDir, QStringLiteral( "schemaExtension.xsd" ) );
49+
QDir resourcesDir = QFileInfo( QgsApplication::serverResourcesPath() ).absoluteDir();
50+
QFileInfo xsdFileInfo( resourcesDir, QStringLiteral( "schemaExtension.xsd" ) );
5151

5252
if ( !xsdFileInfo.exists() )
5353
{
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*****
2+
Content-Type: text/xml; charset=utf-8
3+
4+
<?xml version='1.0' encoding='UTF-8'?>
5+
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.qgis.org/wms" elementFormDefault="qualified" version="1.0.0">
6+
<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"/>
7+
<element xmlns="http://www.w3.org/2001/XMLSchema" name="GetPrint" substitutionGroup="wms:_ExtendedOperation" type="wms:OperationType"/>
8+
<element xmlns="http://www.w3.org/2001/XMLSchema" name="GetStyles" substitutionGroup="wms:_ExtendedOperation" type="wms:OperationType"/>
9+
</schema>

0 commit comments

Comments
 (0)
Please sign in to comment.