[QGIS Commit] r13439 - in trunk/qgis/src: app
plugins/grass/qtermwidget plugins/spatialquery providers/wms
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Sat May 8 11:10:51 EDT 2010
Author: jef
Date: 2010-05-08 11:10:47 -0400 (Sat, 08 May 2010)
New Revision: 13439
Modified:
trunk/qgis/src/app/qgisapp.cpp
trunk/qgis/src/app/qgisapp.h
trunk/qgis/src/app/qgsmaptoolannotation.cpp
trunk/qgis/src/app/qgsmaptoolrotatepointsymbols.cpp
trunk/qgis/src/app/qgsmaptoolsimplify.cpp
trunk/qgis/src/app/qgsnetworkproxyfactory.cpp
trunk/qgis/src/app/qgsnetworkproxyfactory.h
trunk/qgis/src/plugins/grass/qtermwidget/TerminalDisplay.cpp
trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.cpp
trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialogbase.ui
trunk/qgis/src/providers/wms/qgswmsprovider.cpp
Log:
revert debian unrelated part from r13438
Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp 2010-05-08 15:01:27 UTC (rev 13438)
+++ trunk/qgis/src/app/qgisapp.cpp 2010-05-08 15:10:47 UTC (rev 13439)
@@ -154,12 +154,9 @@
#include "qgsattributetabledialog.h"
#include "qgsvectorfilewriter.h"
#include "qgscredentialdialog.h"
+#include "qgsnetworkproxyfactory.h"
#include "qgstilescalewidget.h"
-#if QT_VERSION >= 0x40500
-#include "qgsnetworkproxyfactory.h"
-#endif
-
#ifdef HAVE_QWT
#include "qgsgpsinformationwidget.h"
#endif
@@ -365,6 +362,9 @@
, mPythonUtils( NULL )
, mNAM( NULL )
, mpTileScaleWidget( NULL )
+#if QT_VERSION >= 0x40500
+ , mProxyFactory( NULL )
+#endif
#ifdef HAVE_QWT
, mpGpsWidget( NULL )
#endif
@@ -6627,17 +6627,14 @@
}
#if QT_VERSION >= 0x40500
- if( !mNAM->proxyFactory() )
+ if ( !mProxyFactory )
{
- mNAM->setProxyFactory( new QgsNetworkProxyFactory() );
- }
-
- QgsNetworkProxyFactory *pf = dynamic_cast<QgsNetworkProxyFactory *>( mNAM->proxyFactory() );
- if( pf )
- {
- pf->setProxyAndExcludes( proxy, excludes );
+ mProxyFactory = new QgsNetworkProxyFactory();
+ mNAM->setProxyFactory( mProxyFactory );
}
+ mProxyFactory->setProxyAndExcludes( proxy, excludes );
+
QNetworkDiskCache *cache = qobject_cast<QNetworkDiskCache*>( nam()->cache() );
if ( !cache )
cache = new QNetworkDiskCache( this );
Modified: trunk/qgis/src/app/qgisapp.h
===================================================================
--- trunk/qgis/src/app/qgisapp.h 2010-05-08 15:01:27 UTC (rev 13438)
+++ trunk/qgis/src/app/qgisapp.h 2010-05-08 15:10:47 UTC (rev 13439)
@@ -80,6 +80,10 @@
#include "qgsfeature.h"
#include "qgspoint.h"
+#if QT_VERSION >= 0x40500
+class QgsNetworkProxyFactory;
+#endif
+
/*! \class QgisApp
* \brief Main window for the Qgis application
*/
@@ -1096,6 +1100,10 @@
//! Persistent tile scale slider
QgsTileScaleWidget * mpTileScaleWidget;
+#if QT_VERSION >= 0x40500
+ QgsNetworkProxyFactory *mProxyFactory;
+#endif
+
int mLastComposerId;
#ifdef HAVE_QWT
Modified: trunk/qgis/src/app/qgsmaptoolannotation.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptoolannotation.cpp 2010-05-08 15:01:27 UTC (rev 13438)
+++ trunk/qgis/src/app/qgsmaptoolannotation.cpp 2010-05-08 15:10:47 UTC (rev 13439)
@@ -25,7 +25,7 @@
#include <QDialog>
#include <QMouseEvent>
-QgsMapToolAnnotation::QgsMapToolAnnotation( QgsMapCanvas* canvas ): QgsMapTool( canvas ),
+QgsMapToolAnnotation::QgsMapToolAnnotation( QgsMapCanvas* canvas ): QgsMapTool( canvas ), \
mActiveItem( 0 ), mCurrentMoveAction( QgsAnnotationItem::NoAction ), mLastMousePosition( 0, 0 )
{
mCursor = QCursor( Qt::ArrowCursor );
@@ -158,26 +158,26 @@
double xmax = xmin + size.width();
double ymax = ymin + size.height();
- if ( mCurrentMoveAction == QgsAnnotationItem::ResizeFrameRight ||
- mCurrentMoveAction == QgsAnnotationItem::ResizeFrameRightDown ||
+ if ( mCurrentMoveAction == QgsAnnotationItem::ResizeFrameRight || \
+ mCurrentMoveAction == QgsAnnotationItem::ResizeFrameRightDown || \
mCurrentMoveAction == QgsAnnotationItem::ResizeFrameRightUp )
{
xmax += e->posF().x() - mLastMousePosition.x();
}
- if ( mCurrentMoveAction == QgsAnnotationItem::ResizeFrameLeft ||
- mCurrentMoveAction == QgsAnnotationItem::ResizeFrameLeftDown ||
+ if ( mCurrentMoveAction == QgsAnnotationItem::ResizeFrameLeft || \
+ mCurrentMoveAction == QgsAnnotationItem::ResizeFrameLeftDown || \
mCurrentMoveAction == QgsAnnotationItem::ResizeFrameLeftUp )
{
xmin += e->posF().x() - mLastMousePosition.x();
}
- if ( mCurrentMoveAction == QgsAnnotationItem::ResizeFrameUp ||
- mCurrentMoveAction == QgsAnnotationItem::ResizeFrameLeftUp ||
+ if ( mCurrentMoveAction == QgsAnnotationItem::ResizeFrameUp || \
+ mCurrentMoveAction == QgsAnnotationItem::ResizeFrameLeftUp || \
mCurrentMoveAction == QgsAnnotationItem::ResizeFrameRightUp )
{
ymin += e->posF().y() - mLastMousePosition.y();
}
- if ( mCurrentMoveAction == QgsAnnotationItem::ResizeFrameDown ||
- mCurrentMoveAction == QgsAnnotationItem::ResizeFrameLeftDown ||
+ if ( mCurrentMoveAction == QgsAnnotationItem::ResizeFrameDown || \
+ mCurrentMoveAction == QgsAnnotationItem::ResizeFrameLeftDown || \
mCurrentMoveAction == QgsAnnotationItem::ResizeFrameRightDown )
{
ymax += e->posF().y() - mLastMousePosition.y();
Modified: trunk/qgis/src/app/qgsmaptoolrotatepointsymbols.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptoolrotatepointsymbols.cpp 2010-05-08 15:01:27 UTC (rev 13438)
+++ trunk/qgis/src/app/qgsmaptoolrotatepointsymbols.cpp 2010-05-08 15:10:47 UTC (rev 13439)
@@ -24,8 +24,8 @@
#include <QMessageBox>
#include <QMouseEvent>
-QgsMapToolRotatePointSymbols::QgsMapToolRotatePointSymbols( QgsMapCanvas* canvas ): QgsMapToolEdit( canvas ),
- mActiveLayer( 0 ), mFeatureNumber( 0 ), mCurrentMouseAzimut( 0.0 ), mCurrentRotationFeature( 0.0 ),
+QgsMapToolRotatePointSymbols::QgsMapToolRotatePointSymbols( QgsMapCanvas* canvas ): QgsMapToolEdit( canvas ), \
+ mActiveLayer( 0 ), mFeatureNumber( 0 ), mCurrentMouseAzimut( 0.0 ), mCurrentRotationFeature( 0.0 ), \
mRotating( false ), mRotationItem( 0 ), mCtrlPressed( false )
{
Modified: trunk/qgis/src/app/qgsmaptoolsimplify.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptoolsimplify.cpp 2010-05-08 15:01:27 UTC (rev 13438)
+++ trunk/qgis/src/app/qgsmaptoolsimplify.cpp 2010-05-08 15:10:47 UTC (rev 13439)
@@ -166,7 +166,7 @@
{
count++;
if ( count == 30 && !maximized )
- { //special case when tolerance is too low to be correct so it's near 0
+ { //special case when tolerance is tool low to be correct so it's similat to 0
// else in some special cases this algorithm would create infinite loop
found = true;
minTolerance = 0;
Modified: trunk/qgis/src/app/qgsnetworkproxyfactory.cpp
===================================================================
--- trunk/qgis/src/app/qgsnetworkproxyfactory.cpp 2010-05-08 15:01:27 UTC (rev 13438)
+++ trunk/qgis/src/app/qgsnetworkproxyfactory.cpp 2010-05-08 15:10:47 UTC (rev 13439)
@@ -57,7 +57,7 @@
}
QgsDebugMsg( QString("using user proxy for %1").arg( url ) );
- return QList<QNetworkProxy>() << mProxy;
+ return QList<QNetworkProxy>() << mProxy;
}
#endif // QT_VERSION >= 0x40500
Modified: trunk/qgis/src/app/qgsnetworkproxyfactory.h
===================================================================
--- trunk/qgis/src/app/qgsnetworkproxyfactory.h 2010-05-08 15:01:27 UTC (rev 13438)
+++ trunk/qgis/src/app/qgsnetworkproxyfactory.h 2010-05-08 15:10:47 UTC (rev 13439)
@@ -18,10 +18,12 @@
#ifndef QGSNETWORKPROXYFACTORY_H
#define QGSNETWORKPROXYFACTORY_H
+#if QT_VERSION >= 0x40500
+
#include <QNetworkProxyFactory>
#include <QStringList>
-class QgsNetworkProxyFactory : public QObject, public QNetworkProxyFactory
+class QgsNetworkProxyFactory : public QNetworkProxyFactory
{
public:
QgsNetworkProxyFactory();
@@ -35,4 +37,6 @@
QNetworkProxy mProxy;
};
+#endif // QT_VERSION >= 0x40500
+
#endif
Modified: trunk/qgis/src/plugins/grass/qtermwidget/TerminalDisplay.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qtermwidget/TerminalDisplay.cpp 2010-05-08 15:01:27 UTC (rev 13438)
+++ trunk/qgis/src/plugins/grass/qtermwidget/TerminalDisplay.cpp 2010-05-08 15:10:47 UTC (rev 13439)
@@ -2423,8 +2423,6 @@
case Qt::ImCurrentSelection:
return QString();
break;
- default:
- break;
}
return QVariant();
Modified: trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.cpp
===================================================================
--- trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.cpp 2010-05-08 15:01:27 UTC (rev 13438)
+++ trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.cpp 2010-05-08 15:10:47 UTC (rev 13439)
@@ -190,7 +190,6 @@
buttonBox->button( QDialogButtonBox::Close )->show();
buttonBox->button( QDialogButtonBox::Cancel )->hide();
buttonBox->button( QDialogButtonBox::Ok )->hide();
- adjustSize();
} // void QgsSpatialQueryDialog::runQuery()
void QgsSpatialQueryDialog::setInputsVisible( bool show )
@@ -587,17 +586,8 @@
void QgsSpatialQueryDialog::on_buttonBox_rejected()
{
- if ( grpResults->isHidden() )
- reject();
- else
- {
- grpResults->hide();
- setInputsVisible( true );
- progressBarStatus->show();
- buttonBox->button( QDialogButtonBox::Close )->hide();
- buttonBox->button( QDialogButtonBox::Cancel )->show();
- buttonBox->button( QDialogButtonBox::Ok )->show();
- }
+ reject();
+
} // void QgsSpatialQueryDialog::on_buttonBox_rejected()
void QgsSpatialQueryDialog::on_targetLayerComboBox_currentIndexChanged( int index )
Modified: trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialogbase.ui
===================================================================
--- trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialogbase.ui 2010-05-08 15:01:27 UTC (rev 13438)
+++ trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialogbase.ui 2010-05-08 15:10:47 UTC (rev 13439)
@@ -315,4 +315,22 @@
</layout>
</widget>
<resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>QgsSpatialQueryDialogBase</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>288</x>
+ <y>438</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>292</x>
+ <y>459</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
</ui>
Modified: trunk/qgis/src/providers/wms/qgswmsprovider.cpp
===================================================================
--- trunk/qgis/src/providers/wms/qgswmsprovider.cpp 2010-05-08 15:01:27 UTC (rev 13438)
+++ trunk/qgis/src/providers/wms/qgswmsprovider.cpp 2010-05-08 15:10:47 UTC (rev 13439)
@@ -571,6 +571,8 @@
}
double tres = mResolutions[i];
+ double dx = mTileWidth * tres;
+ double dy = mTileHeight * tres;
// clip view extent to layer extent
double xmin = std::max( viewExtent.xMinimum(), layerExtent.xMinimum() );
@@ -579,12 +581,12 @@
double ymax = std::min( viewExtent.yMaximum(), layerExtent.yMaximum() );
// snap to tile coordinates
- double x0 = floor(( xmin - layerExtent.xMinimum() ) / mTileWidth / tres ) * mTileWidth * tres + layerExtent.xMinimum();
- double y0 = floor(( ymin - layerExtent.yMinimum() ) / mTileHeight / tres ) * mTileHeight * tres + layerExtent.yMinimum();
+ double x0 = floor(( xmin - layerExtent.xMinimum() ) / dx ) * dx + layerExtent.xMinimum();
+ double y0 = floor(( ymin - layerExtent.yMinimum() ) / dy ) * dy + layerExtent.yMinimum();
#ifdef QGISDEBUG
// calculate number of tiles
- int n = ceil(( xmax - xmin ) / mTileWidth / tres ) * ceil(( ymax - ymin ) / mTileHeight / tres );
+ int n = ceil(( xmax - xmin ) / dx ) * ceil(( ymax - ymin ) / dy );
#endif
QgsDebugMsg( QString( "layer extent: %1,%2 %3x%4" )
@@ -602,13 +604,13 @@
);
QgsDebugMsg( QString( "tile extent: %1,%2 %3x%4 pixel:%5x%6 res:%7" )
.arg( x0, 0, 'f' ).arg( y0, 0, 'f' )
- .arg( mTileWidth * tres, 0, 'f' ).arg( mTileHeight * tres, 0, 'f' )
+ .arg( dx, 0, 'f' ).arg( dy, 0, 'f' )
.arg( mTileWidth ).arg( mTileHeight )
.arg( tres, 0, 'f' )
);
QgsDebugMsg( QString( "tile number: %1x%2 = %3" )
- .arg( ceil(( xmax - xmin ) / mTileWidth / tres ) )
- .arg( ceil(( ymax - ymin ) / mTileHeight / tres ) )
+ .arg( ceil(( xmax - xmin ) / dx ) )
+ .arg( ceil(( ymax - ymin ) / dy ) )
.arg( n )
);
@@ -633,40 +635,33 @@
urlargs += QString( "&FORMAT=%1" ).arg( imageMimeType );
urlargs += QString( "&TILED=true" );
- i = 0;
int j = 0;
- double y = y0;
- while ( y < ymax )
+ for ( double y = y0; y < ymax; y += dy )
{
- int k = 0;
- double x = x0;
- while ( x < xmax )
+ for ( double x = x0; x <= xmax; x += dx )
{
QString turl;
turl += url;
turl += QString( changeXY ? "&BBOX=%2,%1,%4,%3" : "&BBOX=%1,%2,%3,%4" )
.arg( x, 0, 'f' )
.arg( y, 0, 'f' )
- .arg( x + mTileWidth * tres, 0, 'f' )
- .arg( y + mTileHeight * tres, 0, 'f' );
+ .arg( x + dx, 0, 'f' )
+ .arg( y + dy, 0, 'f' );
turl += urlargs;
QNetworkRequest request( turl );
- QgsDebugMsg( QString( "tileRequest %1 %2/%3: %4" ).arg( mTileReqNo ).arg( i++ ).arg( n ).arg( turl ) );
+ QgsDebugMsg( QString( "tileRequest %1 %2/%3: %4" ).arg( mTileReqNo ).arg( j++ ).arg( n ).arg( turl ) );
request.setAttribute( QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache );
request.setAttribute( QNetworkRequest::CacheSaveControlAttribute, true );
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 0 ), mTileReqNo );
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 1 ), j );
- request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 2 ), QRectF( x, y, mTileWidth * tres, mTileHeight * tres ) );
+ request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 2 ), QRectF( x, y, dx, dy ) );
QgsDebugMsg( QString( "gettile: %1" ).arg( turl ) );
QNetworkReply *reply = smNAM->get( request );
tileReplies << reply;
connect( reply, SIGNAL( finished() ), this, SLOT( tileReplyFinished() ) );
-
- x = x0 + k++*mTileWidth * tres;
}
- y = y0 + j++*mTileHeight * tres;
}
mWaiting = true;
More information about the QGIS-commit
mailing list