Skip to content
Permalink
Browse files

Added some extra debug info for project path

  • Loading branch information
timlinux committed Jun 28, 2011
1 parent e07596c commit 6186c9f0acf5f2cb389455f465e01e3407a4d66f
Showing with 16 additions and 3 deletions.
  1. +5 −0 src/mapserver/qgis_map_serv.cpp
  2. +11 −3 src/mapserver/qgsprojectparser.cpp
@@ -242,6 +242,11 @@ int main( int argc, char * argv[] )
if ( mapFileIt != parameterMap.end() )
{
configFilePath = mapFileIt->second;
QgsDebugMsg( QString( "Configuration file path set to: %1" ).arg( defaultConfigFilePath ) );
}
else
{
QgsDebugMsg( QString( "Using default configuration file path: %1" ).arg( defaultConfigFilePath ) );
}

QgsConfigParser* adminConfigParser = QgsConfigCache::instance()->searchConfiguration( configFilePath );
@@ -149,6 +149,7 @@ void QgsProjectParser::addLayers( QDomDocument &doc,
{
//add layers from other project files and embed into this group
QString project = convertToAbsolutePath( currentChildElem.attribute( "project" ) );
QgsDebugMsg( QString( "Project path: %1" ).arg( project ) );
QString embeddedGroupName = currentChildElem.attribute( "name" );
QgsProjectParser* p = dynamic_cast<QgsProjectParser*>( QgsConfigCache::instance()->searchConfiguration( project ) );
if ( p )
@@ -360,7 +361,9 @@ QList<QgsMapLayer*> QgsProjectParser::mapLayerFromStyle( const QString& lName, c
{
if ( groupIt->attribute( "embedded" ) == "1" ) //requested group is embedded from another project
{
QgsProjectParser* p = dynamic_cast<QgsProjectParser*>( QgsConfigCache::instance()->searchConfiguration( convertToAbsolutePath( groupIt->attribute( "project" ) ) ) );
QString project = convertToAbsolutePath( groupIt->attribute( "project" ) );
QgsDebugMsg( QString( "Project path: %1" ).arg( project ) );
QgsProjectParser* p = dynamic_cast<QgsProjectParser*>( QgsConfigCache::instance()->searchConfiguration( project ) );
if ( p )
{
QList<QDomElement> pGroupElems = p->legendGroupElements();
@@ -417,6 +420,7 @@ QList<QgsMapLayer*> QgsProjectParser::mapLayerFromStyle( const QString& lName, c
{
QString id = layerIt.value().attribute( "id" );
QString project = layerIt.value().attribute( "project" );
QgsDebugMsg( QString( "Project path: %1" ).arg( project ) );

//get config parser from cache
QgsProjectParser* otherParser = dynamic_cast<QgsProjectParser*>( QgsConfigCache::instance()->searchConfiguration( project ) );
@@ -443,7 +447,9 @@ QList<QgsMapLayer*> QgsProjectParser::mapLayerFromStyle( const QString& lName, c
{
if ( groupIt->attribute( "embedded" ) == "1" )
{
QgsProjectParser* p = dynamic_cast<QgsProjectParser*>( QgsConfigCache::instance()->searchConfiguration( convertToAbsolutePath( groupIt->attribute( "project" ) ) ) );
QString project = convertToAbsolutePath( groupIt->attribute( "project" ) );
QgsDebugMsg( QString( "Project path: %1" ).arg( project ) );
QgsProjectParser* p = dynamic_cast<QgsProjectParser*>( QgsConfigCache::instance()->searchConfiguration( project ) );
if ( p )
{
QMap< QString, QDomElement > pLayers = p->projectLayerElementsByName();
@@ -889,7 +895,9 @@ QgsMapLayer* QgsProjectParser::createLayerFromElement( const QDomElement& elem )
}
else if ( elem.attribute( "embedded" ) == "1" ) //layer is embedded from another project file
{
QgsProjectParser* otherConfig = dynamic_cast<QgsProjectParser*>( QgsConfigCache::instance()->searchConfiguration( convertToAbsolutePath( elem.attribute( "project" ) ) ) );
QString project = convertToAbsolutePath( elem.attribute( "project" ) );
QgsDebugMsg( QString( "Project path: %1" ).arg( project ) );
QgsProjectParser* otherConfig = dynamic_cast<QgsProjectParser*>( QgsConfigCache::instance()->searchConfiguration( project ) );
if ( !otherConfig )
{
return 0;

0 comments on commit 6186c9f

Please sign in to comment.
You can’t perform that action at this time.