|
30 | 30 | #include "qgsmessagelog.h"
|
31 | 31 | #include "qgsauthmanager.h"
|
32 | 32 | #include "qgstilecache.h"
|
| 33 | +#include "qgsstringutils.h" |
33 | 34 |
|
34 | 35 | #ifdef HAVE_GUI
|
35 | 36 | #include "qgsamssourceselect.h"
|
@@ -298,22 +299,36 @@ static inline QString dumpVariantMap( const QVariantMap &variantMap, const QStri
|
298 | 299 | QString result;
|
299 | 300 | if ( !title.isEmpty() )
|
300 | 301 | {
|
301 |
| - result += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>" ).arg( title ); |
302 |
| - } |
303 |
| - else |
304 |
| - { |
305 |
| - result += QStringLiteral( "<tr><td>" ); |
| 302 | + result += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td></td></tr>" ).arg( title ); |
306 | 303 | }
|
307 | 304 | for ( auto it = variantMap.constBegin(); it != variantMap.constEnd(); ++it )
|
308 | 305 | {
|
309 |
| - QVariantMap childMap = it.value().toMap(); |
310 |
| - if ( childMap.isEmpty() ) |
| 306 | + const QVariantMap childMap = it.value().toMap(); |
| 307 | + const QVariantList childList = it.value().toList(); |
| 308 | + if ( !childList.isEmpty() ) |
| 309 | + { |
| 310 | + result += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td><ul>" ).arg( it.key() ); |
| 311 | + for ( const QVariant &v : childList ) |
| 312 | + { |
| 313 | + const QVariantMap grandChildMap = v.toMap(); |
| 314 | + if ( !grandChildMap.isEmpty() ) |
| 315 | + { |
| 316 | + result += QStringLiteral( "<li><table>%1</table></li>" ).arg( dumpVariantMap( grandChildMap ) ); |
| 317 | + } |
| 318 | + else |
| 319 | + { |
| 320 | + result += QStringLiteral( "<li>%1</li>" ).arg( QgsStringUtils::insertLinks( v.toString() ) ); |
| 321 | + } |
| 322 | + } |
| 323 | + result += QStringLiteral( "</ul></td></tr>" ); |
| 324 | + } |
| 325 | + else if ( !childMap.isEmpty() ) |
311 | 326 | {
|
312 |
| - result += QStringLiteral( "%1:%2</td></tr>" ).arg( it.key(), it.value().toString() ); |
| 327 | + result += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td><table>%2</table></td></tr>" ).arg( it.key(), dumpVariantMap( childMap ) ); |
313 | 328 | }
|
314 | 329 | else
|
315 | 330 | {
|
316 |
| - result += QStringLiteral( "%1:<table>%2</table></td></tr>" ).arg( it.key(), dumpVariantMap( childMap ) ); |
| 331 | + result += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>" ).arg( it.key(), QgsStringUtils::insertLinks( it.value().toString() ) ); |
317 | 332 | }
|
318 | 333 | }
|
319 | 334 | return result;
|
|
0 commit comments