Skip to content

Commit

Permalink
wms provider: fix status messages from data items
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Feb 25, 2014
1 parent 6c9dd84 commit 07516fc
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/providers/wms/qgswmsdataitems.cpp
Expand Up @@ -69,7 +69,24 @@ QVector<QgsDataItem*> QgsWMSConnectionItem::createChildren()
}

QgsWmsCapabilitiesDownload capDownload( wmsSettings.baseUrl(), wmsSettings.authorization() );
connect( &capDownload, SIGNAL( statusChanged( QString ) ), this, SLOT( showStatusMessage( QString ) ) );

QWidget *mainWindow = 0;

QWidgetList topLevelWidgets = qApp->topLevelWidgets();
for ( QWidgetList::iterator it = topLevelWidgets.begin(); it != topLevelWidgets.end(); ++it )
{
if (( *it )->objectName() == "QgisApp" )
{
mainWindow = *it;
break;
}
}

if ( mainWindow )
{
connect( &capDownload, SIGNAL( statusChanged( QString ) ), mainWindow, SLOT( showStatusMessage( QString ) ) );
}


QApplication::setOverrideCursor( Qt::WaitCursor );
bool res = capDownload.downloadCapabilities();
Expand Down

0 comments on commit 07516fc

Please sign in to comment.