@@ -62,7 +62,6 @@ QgsWCSProjectParser* QgsConfigCache::wcsConfiguration( const QString& filePath )
6262 }
6363 p = new QgsWCSProjectParser ( filePath );
6464 mWCSConfigCache .insert ( filePath, p );
65- mFileSystemWatcher .addPath ( filePath );
6665 }
6766
6867 QgsMSLayerCache::instance ()->setProjectMaxLayers ( p->wcsLayers ().size () );
@@ -81,7 +80,6 @@ QgsWFSProjectParser* QgsConfigCache::wfsConfiguration( const QString& filePath )
8180 }
8281 p = new QgsWFSProjectParser ( filePath );
8382 mWFSConfigCache .insert ( filePath, p );
84- mFileSystemWatcher .addPath ( filePath );
8583 }
8684
8785 QgsMSLayerCache::instance ()->setProjectMaxLayers ( p->wfsLayers ().size () );
@@ -111,7 +109,6 @@ QgsWMSConfigParser* QgsConfigCache::wmsConfiguration( const QString& filePath, c
111109 p = new QgsWMSProjectParser ( filePath );
112110 }
113111 mWMSConfigCache .insert ( filePath, p );
114- mFileSystemWatcher .addPath ( filePath );
115112 }
116113
117114 QgsMSLayerCache::instance ()->setProjectMaxLayers ( p->nLayers () );
@@ -133,22 +130,22 @@ QDomDocument* QgsConfigCache::xmlDocument( const QString& filePath )
133130 QgsMessageLog::logMessage ( " Error, cannot open configuration file '" + filePath + " '" , " Server" , QgsMessageLog::CRITICAL );
134131 return 0 ;
135132 }
136-
133+
137134 // first get cache
138135 QDomDocument* xmlDoc = mXmlDocumentCache .object ( filePath );
139136 if ( !xmlDoc )
140137 {
141138 // then create xml document
142- xmlDoc = new QDomDocument ();
143- QString errorMsg;
144- int line, column;
145- if ( !xmlDoc->setContent ( &configFile, true , &errorMsg, &line, &column ) )
146- {
147- QgsMessageLog::logMessage ( " Error parsing file '" + filePath +
148- QString ( " ': parse error %1 at row %2, column %3" ).arg ( errorMsg ).arg ( line ).arg ( column ), " Server" , QgsMessageLog::CRITICAL );
149- delete xmlDoc;
150- return 0 ;
151- }
139+ xmlDoc = new QDomDocument ();
140+ QString errorMsg;
141+ int line, column;
142+ if ( !xmlDoc->setContent ( &configFile, true , &errorMsg, &line, &column ) )
143+ {
144+ QgsMessageLog::logMessage ( " Error parsing file '" + filePath +
145+ QString ( " ': parse error %1 at row %2, column %3" ).arg ( errorMsg ).arg ( line ).arg ( column ), " Server" , QgsMessageLog::CRITICAL );
146+ delete xmlDoc;
147+ return 0 ;
148+ }
152149 mXmlDocumentCache .insert ( filePath, xmlDoc );
153150 mFileSystemWatcher .addPath ( filePath );
154151 }
0 commit comments