mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-30 00:04:11 -04:00
Cleanup config cache
This commit is contained in:
parent
4e28719695
commit
fd8c92f3e3
@ -350,7 +350,7 @@ int main( int argc, char * argv[] )
|
||||
}
|
||||
else //WMS else
|
||||
{
|
||||
QgsWMSConfigParser* p = QgsConfigCache::instance()->wmsConfiguration( configFilePath );
|
||||
QgsWMSConfigParser* p = QgsConfigCache::instance()->wmsConfiguration( configFilePath, parameterMap );
|
||||
if ( !p )
|
||||
{
|
||||
//error handling
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "qgswcsprojectparser.h"
|
||||
#include "qgswfsprojectparser.h"
|
||||
#include "qgswmsprojectparser.h"
|
||||
#include "qgssldconfigparser.h"
|
||||
|
||||
QgsConfigCache* QgsConfigCache::instance()
|
||||
{
|
||||
@ -74,7 +75,7 @@ QgsWFSProjectParser* QgsConfigCache::wfsConfiguration( const QString& filePath )
|
||||
return p;
|
||||
}
|
||||
|
||||
QgsWMSConfigParser* QgsConfigCache::wmsConfiguration( const QString& filePath )
|
||||
QgsWMSConfigParser* QgsConfigCache::wmsConfiguration( const QString& filePath, const QMap<QString, QString>& parameterMap )
|
||||
{
|
||||
QgsWMSConfigParser* p = mWMSConfigCache.object( filePath );
|
||||
if ( p )
|
||||
@ -93,6 +94,7 @@ QgsWMSConfigParser* QgsConfigCache::wmsConfiguration( const QString& filePath )
|
||||
QDomElement documentElem = doc->documentElement();
|
||||
if ( documentElem.tagName() == "StyledLayerDescriptor" )
|
||||
{
|
||||
p = new QgsSLDConfigParser( doc, parameterMap );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include <QCache>
|
||||
#include <QFileSystemWatcher>
|
||||
#include <QMap>
|
||||
#include <QObject>
|
||||
|
||||
class QgsWCSProjectParser;
|
||||
@ -37,7 +38,7 @@ class QgsConfigCache: public QObject
|
||||
|
||||
QgsWCSProjectParser* wcsConfiguration( const QString& filePath );
|
||||
QgsWFSProjectParser* wfsConfiguration( const QString& filePath );
|
||||
QgsWMSConfigParser* wmsConfiguration( const QString& filePath );
|
||||
QgsWMSConfigParser* wmsConfiguration( const QString& filePath, const QMap<QString, QString>& parameterMap = QMap< QString, QString >() );
|
||||
|
||||
private:
|
||||
QgsConfigCache();
|
||||
|
@ -329,6 +329,11 @@ QgsRectangle QgsServerProjectParser::projectExtent() const
|
||||
return extent;
|
||||
}
|
||||
|
||||
int QgsServerProjectParser::numberOfLayers() const
|
||||
{
|
||||
return mProjectLayerElements.size();
|
||||
}
|
||||
|
||||
QString QgsServerProjectParser::layerName( const QDomElement& layerElem ) const
|
||||
{
|
||||
if ( layerElem.isNull() )
|
||||
|
@ -117,6 +117,8 @@ class QgsServerProjectParser
|
||||
|
||||
QgsRectangle projectExtent() const;
|
||||
|
||||
int numberOfLayers() const;
|
||||
|
||||
private:
|
||||
|
||||
/**Content of project file*/
|
||||
|
@ -1591,30 +1591,6 @@ int QgsWMSServer::initializeSLDParser( QStringList& layersList, QStringList& sty
|
||||
layersList << *layersIt;
|
||||
stylesList << *stylesIt;
|
||||
}
|
||||
|
||||
#if 0 //todo: fixme
|
||||
QgsSLDParser* userSLDParser = new QgsSLDParser( theDocument );
|
||||
userSLDParser->setParameterMap( mParameters );
|
||||
userSLDParser->setFallbackParser( mConfigParser );
|
||||
mConfigParser = userSLDParser;
|
||||
//now replace the content of layersList and stylesList (if present)
|
||||
layersList.clear();
|
||||
stylesList.clear();
|
||||
QStringList layersSTDList;
|
||||
QStringList stylesSTDList;
|
||||
if ( mConfigParser->layersAndStyles( layersSTDList, stylesSTDList ) != 0 )
|
||||
{
|
||||
QgsDebugMsg( "Error, no layers and styles found in SLD" );
|
||||
return 0;
|
||||
}
|
||||
QStringList::const_iterator layersIt;
|
||||
QStringList::const_iterator stylesIt;
|
||||
for ( layersIt = layersSTDList.constBegin(), stylesIt = stylesSTDList.constBegin(); layersIt != layersSTDList.constEnd(); ++layersIt, ++stylesIt )
|
||||
{
|
||||
layersList << *layersIt;
|
||||
stylesList << *stylesIt;
|
||||
}
|
||||
#endif //0 //todo: fixme
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user