25 if ( !layers.empty() )
28 for (
const QDomNode &layer : layers )
36 const QString type = layerNode.toElement().attribute( QStringLiteral(
"type" ) );
40 QgsDebugMsg( QStringLiteral(
"cannot find ``type'' attribute" ) );
45 if (
"raster" == type )
51 else if (
"vector" == type )
65 const QDomNode dataSourceNode = layerNode.namedItem( QStringLiteral(
"datasource" ) );
67 if ( dataSourceNode.isNull() )
69 QgsDebugMsg( QStringLiteral(
"cannot find datasource node" ) );
74 return dataSourceNode.toElement().text();
89 if ( ds.contains( QLatin1String(
"host=" ) ) )
93 else if ( ds.contains( QLatin1String(
"dbname=" ) ) )
108 QgsDebugMsg( QStringLiteral(
"unknown ``type'' attribute" ) );
116 const QDomNode dataSourceNode = layerNode.namedItem( QStringLiteral(
"datasource" ) );
117 const QDomElement dataSourceElement = dataSourceNode.toElement();
118 QDomText dataSourceText = dataSourceElement.firstChild().toText();