Skip to content

Commit 9f81f1a

Browse files
author
jef
committedMay 8, 2010
revert debian unrelated part from r13438
git-svn-id: http://svn.osgeo.org/qgis/trunk@13439 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 8d89272 commit 9f81f1a

11 files changed

+69
-59
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,8 @@
154154
#include "qgsattributetabledialog.h"
155155
#include "qgsvectorfilewriter.h"
156156
#include "qgscredentialdialog.h"
157-
#include "qgstilescalewidget.h"
158-
159-
#if QT_VERSION >= 0x40500
160157
#include "qgsnetworkproxyfactory.h"
161-
#endif
158+
#include "qgstilescalewidget.h"
162159

163160
#ifdef HAVE_QWT
164161
#include "qgsgpsinformationwidget.h"
@@ -365,6 +362,9 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
365362
, mPythonUtils( NULL )
366363
, mNAM( NULL )
367364
, mpTileScaleWidget( NULL )
365+
#if QT_VERSION >= 0x40500
366+
, mProxyFactory( NULL )
367+
#endif
368368
#ifdef HAVE_QWT
369369
, mpGpsWidget( NULL )
370370
#endif
@@ -6627,17 +6627,14 @@ void QgisApp::namUpdate()
66276627
}
66286628

66296629
#if QT_VERSION >= 0x40500
6630-
if( !mNAM->proxyFactory() )
6630+
if ( !mProxyFactory )
66316631
{
6632-
mNAM->setProxyFactory( new QgsNetworkProxyFactory() );
6633-
}
6634-
6635-
QgsNetworkProxyFactory *pf = dynamic_cast<QgsNetworkProxyFactory *>( mNAM->proxyFactory() );
6636-
if( pf )
6637-
{
6638-
pf->setProxyAndExcludes( proxy, excludes );
6632+
mProxyFactory = new QgsNetworkProxyFactory();
6633+
mNAM->setProxyFactory( mProxyFactory );
66396634
}
66406635

6636+
mProxyFactory->setProxyAndExcludes( proxy, excludes );
6637+
66416638
QNetworkDiskCache *cache = qobject_cast<QNetworkDiskCache*>( nam()->cache() );
66426639
if ( !cache )
66436640
cache = new QNetworkDiskCache( this );

‎src/app/qgisapp.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ class QgsGPSInformationWidget;
8080
#include "qgsfeature.h"
8181
#include "qgspoint.h"
8282

83+
#if QT_VERSION >= 0x40500
84+
class QgsNetworkProxyFactory;
85+
#endif
86+
8387
/*! \class QgisApp
8488
* \brief Main window for the Qgis application
8589
*/
@@ -1096,6 +1100,10 @@ class QgisApp : public QMainWindow
10961100
//! Persistent tile scale slider
10971101
QgsTileScaleWidget * mpTileScaleWidget;
10981102

1103+
#if QT_VERSION >= 0x40500
1104+
QgsNetworkProxyFactory *mProxyFactory;
1105+
#endif
1106+
10991107
int mLastComposerId;
11001108

11011109
#ifdef HAVE_QWT

‎src/app/qgsmaptoolannotation.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <QDialog>
2626
#include <QMouseEvent>
2727

28-
QgsMapToolAnnotation::QgsMapToolAnnotation( QgsMapCanvas* canvas ): QgsMapTool( canvas ),
28+
QgsMapToolAnnotation::QgsMapToolAnnotation( QgsMapCanvas* canvas ): QgsMapTool( canvas ), \
2929
mActiveItem( 0 ), mCurrentMoveAction( QgsAnnotationItem::NoAction ), mLastMousePosition( 0, 0 )
3030
{
3131
mCursor = QCursor( Qt::ArrowCursor );
@@ -158,26 +158,26 @@ void QgsMapToolAnnotation::canvasMoveEvent( QMouseEvent * e )
158158
double xmax = xmin + size.width();
159159
double ymax = ymin + size.height();
160160

161-
if ( mCurrentMoveAction == QgsAnnotationItem::ResizeFrameRight ||
162-
mCurrentMoveAction == QgsAnnotationItem::ResizeFrameRightDown ||
161+
if ( mCurrentMoveAction == QgsAnnotationItem::ResizeFrameRight || \
162+
mCurrentMoveAction == QgsAnnotationItem::ResizeFrameRightDown || \
163163
mCurrentMoveAction == QgsAnnotationItem::ResizeFrameRightUp )
164164
{
165165
xmax += e->posF().x() - mLastMousePosition.x();
166166
}
167-
if ( mCurrentMoveAction == QgsAnnotationItem::ResizeFrameLeft ||
168-
mCurrentMoveAction == QgsAnnotationItem::ResizeFrameLeftDown ||
167+
if ( mCurrentMoveAction == QgsAnnotationItem::ResizeFrameLeft || \
168+
mCurrentMoveAction == QgsAnnotationItem::ResizeFrameLeftDown || \
169169
mCurrentMoveAction == QgsAnnotationItem::ResizeFrameLeftUp )
170170
{
171171
xmin += e->posF().x() - mLastMousePosition.x();
172172
}
173-
if ( mCurrentMoveAction == QgsAnnotationItem::ResizeFrameUp ||
174-
mCurrentMoveAction == QgsAnnotationItem::ResizeFrameLeftUp ||
173+
if ( mCurrentMoveAction == QgsAnnotationItem::ResizeFrameUp || \
174+
mCurrentMoveAction == QgsAnnotationItem::ResizeFrameLeftUp || \
175175
mCurrentMoveAction == QgsAnnotationItem::ResizeFrameRightUp )
176176
{
177177
ymin += e->posF().y() - mLastMousePosition.y();
178178
}
179-
if ( mCurrentMoveAction == QgsAnnotationItem::ResizeFrameDown ||
180-
mCurrentMoveAction == QgsAnnotationItem::ResizeFrameLeftDown ||
179+
if ( mCurrentMoveAction == QgsAnnotationItem::ResizeFrameDown || \
180+
mCurrentMoveAction == QgsAnnotationItem::ResizeFrameLeftDown || \
181181
mCurrentMoveAction == QgsAnnotationItem::ResizeFrameRightDown )
182182
{
183183
ymax += e->posF().y() - mLastMousePosition.y();

‎src/app/qgsmaptoolrotatepointsymbols.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#include <QMessageBox>
2525
#include <QMouseEvent>
2626

27-
QgsMapToolRotatePointSymbols::QgsMapToolRotatePointSymbols( QgsMapCanvas* canvas ): QgsMapToolEdit( canvas ),
28-
mActiveLayer( 0 ), mFeatureNumber( 0 ), mCurrentMouseAzimut( 0.0 ), mCurrentRotationFeature( 0.0 ),
27+
QgsMapToolRotatePointSymbols::QgsMapToolRotatePointSymbols( QgsMapCanvas* canvas ): QgsMapToolEdit( canvas ), \
28+
mActiveLayer( 0 ), mFeatureNumber( 0 ), mCurrentMouseAzimut( 0.0 ), mCurrentRotationFeature( 0.0 ), \
2929
mRotating( false ), mRotationItem( 0 ), mCtrlPressed( false )
3030
{
3131

‎src/app/qgsmaptoolsimplify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ bool QgsMapToolSimplify::calculateSliderBoudaries()
166166
{
167167
count++;
168168
if ( count == 30 && !maximized )
169-
{ //special case when tolerance is too low to be correct so it's near 0
169+
{ //special case when tolerance is tool low to be correct so it's similat to 0
170170
// else in some special cases this algorithm would create infinite loop
171171
found = true;
172172
minTolerance = 0;

‎src/app/qgsnetworkproxyfactory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ QList<QNetworkProxy> QgsNetworkProxyFactory::queryProxy( const QNetworkProxyQuer
5757
}
5858

5959
QgsDebugMsg( QString("using user proxy for %1").arg( url ) );
60-
return QList<QNetworkProxy>() << mProxy;
60+
return QList<QNetworkProxy>() << mProxy;
6161
}
6262

6363
#endif // QT_VERSION >= 0x40500

‎src/app/qgsnetworkproxyfactory.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
#ifndef QGSNETWORKPROXYFACTORY_H
1919
#define QGSNETWORKPROXYFACTORY_H
2020

21+
#if QT_VERSION >= 0x40500
22+
2123
#include <QNetworkProxyFactory>
2224
#include <QStringList>
2325

24-
class QgsNetworkProxyFactory : public QObject, public QNetworkProxyFactory
26+
class QgsNetworkProxyFactory : public QNetworkProxyFactory
2527
{
2628
public:
2729
QgsNetworkProxyFactory();
@@ -35,4 +37,6 @@ class QgsNetworkProxyFactory : public QObject, public QNetworkProxyFactory
3537
QNetworkProxy mProxy;
3638
};
3739

40+
#endif // QT_VERSION >= 0x40500
41+
3842
#endif

‎src/plugins/grass/qtermwidget/TerminalDisplay.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2423,8 +2423,6 @@ QVariant TerminalDisplay::inputMethodQuery( Qt::InputMethodQuery query ) const
24232423
case Qt::ImCurrentSelection:
24242424
return QString();
24252425
break;
2426-
default:
2427-
break;
24282426
}
24292427

24302428
return QVariant();

‎src/plugins/spatialquery/qgsspatialquerydialog.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ void QgsSpatialQueryDialog::runQuery()
190190
buttonBox->button( QDialogButtonBox::Close )->show();
191191
buttonBox->button( QDialogButtonBox::Cancel )->hide();
192192
buttonBox->button( QDialogButtonBox::Ok )->hide();
193-
adjustSize();
194193
} // void QgsSpatialQueryDialog::runQuery()
195194

196195
void QgsSpatialQueryDialog::setInputsVisible( bool show )
@@ -587,17 +586,8 @@ void QgsSpatialQueryDialog::on_buttonBox_accepted()
587586

588587
void QgsSpatialQueryDialog::on_buttonBox_rejected()
589588
{
590-
if ( grpResults->isHidden() )
591-
reject();
592-
else
593-
{
594-
grpResults->hide();
595-
setInputsVisible( true );
596-
progressBarStatus->show();
597-
buttonBox->button( QDialogButtonBox::Close )->hide();
598-
buttonBox->button( QDialogButtonBox::Cancel )->show();
599-
buttonBox->button( QDialogButtonBox::Ok )->show();
600-
}
589+
reject();
590+
601591
} // void QgsSpatialQueryDialog::on_buttonBox_rejected()
602592

603593
void QgsSpatialQueryDialog::on_targetLayerComboBox_currentIndexChanged( int index )

‎src/plugins/spatialquery/qgsspatialquerydialogbase.ui

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,4 +315,22 @@ p, li { white-space: pre-wrap; }
315315
</layout>
316316
</widget>
317317
<resources/>
318+
<connections>
319+
<connection>
320+
<sender>buttonBox</sender>
321+
<signal>rejected()</signal>
322+
<receiver>QgsSpatialQueryDialogBase</receiver>
323+
<slot>reject()</slot>
324+
<hints>
325+
<hint type="sourcelabel">
326+
<x>288</x>
327+
<y>438</y>
328+
</hint>
329+
<hint type="destinationlabel">
330+
<x>292</x>
331+
<y>459</y>
332+
</hint>
333+
</hints>
334+
</connection>
335+
</connections>
318336
</ui>

‎src/providers/wms/qgswmsprovider.cpp

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,8 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
571571
}
572572

573573
double tres = mResolutions[i];
574+
double dx = mTileWidth * tres;
575+
double dy = mTileHeight * tres;
574576

575577
// clip view extent to layer extent
576578
double xmin = std::max( viewExtent.xMinimum(), layerExtent.xMinimum() );
@@ -579,12 +581,12 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
579581
double ymax = std::min( viewExtent.yMaximum(), layerExtent.yMaximum() );
580582

581583
// snap to tile coordinates
582-
double x0 = floor(( xmin - layerExtent.xMinimum() ) / mTileWidth / tres ) * mTileWidth * tres + layerExtent.xMinimum();
583-
double y0 = floor(( ymin - layerExtent.yMinimum() ) / mTileHeight / tres ) * mTileHeight * tres + layerExtent.yMinimum();
584+
double x0 = floor(( xmin - layerExtent.xMinimum() ) / dx ) * dx + layerExtent.xMinimum();
585+
double y0 = floor(( ymin - layerExtent.yMinimum() ) / dy ) * dy + layerExtent.yMinimum();
584586

585587
#ifdef QGISDEBUG
586588
// calculate number of tiles
587-
int n = ceil(( xmax - xmin ) / mTileWidth / tres ) * ceil(( ymax - ymin ) / mTileHeight / tres );
589+
int n = ceil(( xmax - xmin ) / dx ) * ceil(( ymax - ymin ) / dy );
588590
#endif
589591

590592
QgsDebugMsg( QString( "layer extent: %1,%2 %3x%4" )
@@ -602,13 +604,13 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
602604
);
603605
QgsDebugMsg( QString( "tile extent: %1,%2 %3x%4 pixel:%5x%6 res:%7" )
604606
.arg( x0, 0, 'f' ).arg( y0, 0, 'f' )
605-
.arg( mTileWidth * tres, 0, 'f' ).arg( mTileHeight * tres, 0, 'f' )
607+
.arg( dx, 0, 'f' ).arg( dy, 0, 'f' )
606608
.arg( mTileWidth ).arg( mTileHeight )
607609
.arg( tres, 0, 'f' )
608610
);
609611
QgsDebugMsg( QString( "tile number: %1x%2 = %3" )
610-
.arg( ceil(( xmax - xmin ) / mTileWidth / tres ) )
611-
.arg( ceil(( ymax - ymin ) / mTileHeight / tres ) )
612+
.arg( ceil(( xmax - xmin ) / dx ) )
613+
.arg( ceil(( ymax - ymin ) / dy ) )
612614
.arg( n )
613615
);
614616

@@ -633,40 +635,33 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
633635
urlargs += QString( "&FORMAT=%1" ).arg( imageMimeType );
634636
urlargs += QString( "&TILED=true" );
635637

636-
i = 0;
637638
int j = 0;
638-
double y = y0;
639-
while ( y < ymax )
639+
for ( double y = y0; y < ymax; y += dy )
640640
{
641-
int k = 0;
642-
double x = x0;
643-
while ( x < xmax )
641+
for ( double x = x0; x <= xmax; x += dx )
644642
{
645643
QString turl;
646644
turl += url;
647645
turl += QString( changeXY ? "&BBOX=%2,%1,%4,%3" : "&BBOX=%1,%2,%3,%4" )
648646
.arg( x, 0, 'f' )
649647
.arg( y, 0, 'f' )
650-
.arg( x + mTileWidth * tres, 0, 'f' )
651-
.arg( y + mTileHeight * tres, 0, 'f' );
648+
.arg( x + dx, 0, 'f' )
649+
.arg( y + dy, 0, 'f' );
652650
turl += urlargs;
653651

654652
QNetworkRequest request( turl );
655-
QgsDebugMsg( QString( "tileRequest %1 %2/%3: %4" ).arg( mTileReqNo ).arg( i++ ).arg( n ).arg( turl ) );
653+
QgsDebugMsg( QString( "tileRequest %1 %2/%3: %4" ).arg( mTileReqNo ).arg( j++ ).arg( n ).arg( turl ) );
656654
request.setAttribute( QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache );
657655
request.setAttribute( QNetworkRequest::CacheSaveControlAttribute, true );
658656
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 0 ), mTileReqNo );
659657
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 1 ), j );
660-
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 2 ), QRectF( x, y, mTileWidth * tres, mTileHeight * tres ) );
658+
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 2 ), QRectF( x, y, dx, dy ) );
661659

662660
QgsDebugMsg( QString( "gettile: %1" ).arg( turl ) );
663661
QNetworkReply *reply = smNAM->get( request );
664662
tileReplies << reply;
665663
connect( reply, SIGNAL( finished() ), this, SLOT( tileReplyFinished() ) );
666-
667-
x = x0 + k++*mTileWidth * tres;
668664
}
669-
y = y0 + j++*mTileHeight * tres;
670665
}
671666

672667
mWaiting = true;

0 commit comments

Comments
 (0)
Please sign in to comment.