[QGIS Commit] r15472 - in trunk/qgis/src: app core
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Mon Mar 14 08:45:56 EDT 2011
Author: jef
Date: 2011-03-14 05:45:56 -0700 (Mon, 14 Mar 2011)
New Revision: 15472
Modified:
trunk/qgis/src/app/qgstilescalewidget.cpp
trunk/qgis/src/core/qgsrasterprojector.cpp
Log:
fix #3608
Modified: trunk/qgis/src/app/qgstilescalewidget.cpp
===================================================================
--- trunk/qgis/src/app/qgstilescalewidget.cpp 2011-03-14 08:51:11 UTC (rev 15471)
+++ trunk/qgis/src/app/qgstilescalewidget.cpp 2011-03-14 12:45:56 UTC (rev 15472)
@@ -36,25 +36,34 @@
{
QgsRasterLayer *rl = qobject_cast<QgsRasterLayer *>( layer );
- if ( !rl || rl->providerKey() != "wms" || !rl->publicSource().contains( "tiled=" ) )
+ mResolutions.clear();
+ mSlider->setDisabled( true );
+
+ if ( !rl || rl->providerKey() != "wms" )
+ return;
+
+ QString uri = rl->source();
+ int tiledpos = uri.indexOf( "tiled=" );
+ int urlpos = uri.indexOf( "url=" );
+
+ if ( tiledpos >= 0 && urlpos >= 0 && urlpos > tiledpos )
{
- mResolutions.clear();
- mSlider->setDisabled( true );
- }
- else
- {
- QString uri = rl->publicSource().mid( rl->publicSource().indexOf( "tiled=" ) + 6 );
+ uri = uri.mid( tiledpos + 6 );
int pos = uri.indexOf( "," );
if ( pos >= 0 )
uri = uri.left( pos );
QStringList params = uri.split( ";" );
+ if ( params.size() < 3 )
+ return;
params.takeFirst();
params.takeFirst();
mResolutions.clear();
foreach( QString r, params )
- mResolutions << r.toDouble();
+ {
+ mResolutions << r.toDouble();
+ }
qSort( mResolutions );
for ( int i = 0; i < mResolutions.size(); i++ )
Modified: trunk/qgis/src/core/qgsrasterprojector.cpp
===================================================================
--- trunk/qgis/src/core/qgsrasterprojector.cpp 2011-03-14 08:51:11 UTC (rev 15471)
+++ trunk/qgis/src/core/qgsrasterprojector.cpp 2011-03-14 12:45:56 UTC (rev 15472)
@@ -363,7 +363,7 @@
bool QgsRasterProjector::calcCol( int theCol )
{
- QgsDebugMsg( QString( "theCol = %1" ).arg( theCol ) );
+ QgsDebugMsgLevel( QString( "theCol = %1" ).arg( theCol ), 3 );
for ( int i = 0; i < mCPRows; i++ )
{
calcCP( i, theCol );
More information about the QGIS-commit
mailing list