Skip to content

Commit

Permalink
Remove code no longer needed in QgsConfigCache
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Nov 21, 2014
1 parent 6c24638 commit 536efdd
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions src/mapserver/qgsconfigcache.cpp
Expand Up @@ -62,7 +62,6 @@ QgsWCSProjectParser* QgsConfigCache::wcsConfiguration( const QString& filePath )
} }
p = new QgsWCSProjectParser( filePath ); p = new QgsWCSProjectParser( filePath );
mWCSConfigCache.insert( filePath, p ); mWCSConfigCache.insert( filePath, p );
mFileSystemWatcher.addPath( filePath );
} }


QgsMSLayerCache::instance()->setProjectMaxLayers( p->wcsLayers().size() ); QgsMSLayerCache::instance()->setProjectMaxLayers( p->wcsLayers().size() );
Expand All @@ -81,7 +80,6 @@ QgsWFSProjectParser* QgsConfigCache::wfsConfiguration( const QString& filePath )
} }
p = new QgsWFSProjectParser( filePath ); p = new QgsWFSProjectParser( filePath );
mWFSConfigCache.insert( filePath, p ); mWFSConfigCache.insert( filePath, p );
mFileSystemWatcher.addPath( filePath );
} }


QgsMSLayerCache::instance()->setProjectMaxLayers( p->wfsLayers().size() ); QgsMSLayerCache::instance()->setProjectMaxLayers( p->wfsLayers().size() );
Expand Down Expand Up @@ -111,7 +109,6 @@ QgsWMSConfigParser* QgsConfigCache::wmsConfiguration( const QString& filePath, c
p = new QgsWMSProjectParser( filePath ); p = new QgsWMSProjectParser( filePath );
} }
mWMSConfigCache.insert( filePath, p ); mWMSConfigCache.insert( filePath, p );
mFileSystemWatcher.addPath( filePath );
} }


QgsMSLayerCache::instance()->setProjectMaxLayers( p->nLayers() ); QgsMSLayerCache::instance()->setProjectMaxLayers( p->nLayers() );
Expand All @@ -133,22 +130,22 @@ QDomDocument* QgsConfigCache::xmlDocument( const QString& filePath )
QgsMessageLog::logMessage( "Error, cannot open configuration file '" + filePath + "'", "Server", QgsMessageLog::CRITICAL ); QgsMessageLog::logMessage( "Error, cannot open configuration file '" + filePath + "'", "Server", QgsMessageLog::CRITICAL );
return 0; return 0;
} }

// first get cache // first get cache
QDomDocument* xmlDoc = mXmlDocumentCache.object( filePath ); QDomDocument* xmlDoc = mXmlDocumentCache.object( filePath );
if ( !xmlDoc ) if ( !xmlDoc )
{ {
//then create xml document //then create xml document
xmlDoc = new QDomDocument(); xmlDoc = new QDomDocument();
QString errorMsg; QString errorMsg;
int line, column; int line, column;
if ( !xmlDoc->setContent( &configFile, true, &errorMsg, &line, &column ) ) if ( !xmlDoc->setContent( &configFile, true, &errorMsg, &line, &column ) )
{ {
QgsMessageLog::logMessage( "Error parsing file '" + filePath + QgsMessageLog::logMessage( "Error parsing file '" + filePath +
QString( "': parse error %1 at row %2, column %3" ).arg( errorMsg ).arg( line ).arg( column ), "Server", QgsMessageLog::CRITICAL ); QString( "': parse error %1 at row %2, column %3" ).arg( errorMsg ).arg( line ).arg( column ), "Server", QgsMessageLog::CRITICAL );
delete xmlDoc; delete xmlDoc;
return 0; return 0;
} }
mXmlDocumentCache.insert( filePath, xmlDoc ); mXmlDocumentCache.insert( filePath, xmlDoc );
mFileSystemWatcher.addPath( filePath ); mFileSystemWatcher.addPath( filePath );
} }
Expand Down

0 comments on commit 536efdd

Please sign in to comment.