Skip to content

Commit

Permalink
wms provider: add trailing slash, if url path is empty otherwise and …
Browse files Browse the repository at this point in the history
…clear tileset list, when a tileless wms server is connected
  • Loading branch information
jef-n committed May 9, 2013
1 parent 85c67be commit b6c7496
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/gui/qgsnewhttpconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ void QgsNewHttpConnection::accept()
url.removeEncodedQueryItem( params["FORMAT"].first );
}

if( url.encodedPath().isEmpty() )
{
url.setEncodedPath( "/" );
}

settings.setValue( key + "/url", url.toString() );
if ( mBaseKey == "/Qgis/connections-wms/" || mBaseKey == "/Qgis/connections-wcs/" )
{
Expand Down
6 changes: 5 additions & 1 deletion src/providers/wms/qgswmssourceselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,10 @@ bool QgsWMSSourceSelect::populateLayerList( QgsWmsProvider *wmsProvider )
lstTilesets->setSortingEnabled( true );
lstTilesets->sortByColumn( 0, Qt::AscendingOrder );
}
else
{
lstTilesets->setRowCount( 0 );
}

// If we got some layers, let the user add them to the map
if ( lstLayers->topLevelItemCount() == 1 )
Expand Down Expand Up @@ -890,7 +894,7 @@ void QgsWMSSourceSelect::updateButtons()
// disable tilesets, when layer are selected or no tilesets available
lstLayers->setEnabled( true );
tabServers->setTabEnabled( tabServers->indexOf( tabLayerOrder ), mLayerOrderTreeWidget->topLevelItemCount() > 0 );
tabServers->setTabEnabled( tabServers->indexOf( tabTilesets ), mLayerOrderTreeWidget->topLevelItemCount() == 0 && lstTilesets->rowCount() );
tabServers->setTabEnabled( tabServers->indexOf( tabTilesets ), mLayerOrderTreeWidget->topLevelItemCount() == 0 && lstTilesets->rowCount() > 0 );
btnGrpImageEncoding->setEnabled( true );
}

Expand Down

0 comments on commit b6c7496

Please sign in to comment.