Skip to content

Commit 1b4be69

Browse files
author
jef
committed
remove Qt 4.5 dependencies
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13143 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent b04de49 commit 1b4be69

File tree

6 files changed

+36
-12
lines changed

6 files changed

+36
-12
lines changed

src/app/qgisapp.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,14 @@
6868
#include <QWhatsThis>
6969

7070
#include <QNetworkAccessManager>
71-
#include <QNetworkDiskCache>
7271
#include <QNetworkReply>
7372
#include <QNetworkProxy>
7473
#include <QAuthenticator>
7574

75+
#if QT_VERSION >= 0x40500
76+
#include <QNetworkDiskCache>
77+
#endif
78+
7679
//
7780
// Mac OS X Includes
7881
// Must include before GEOS 3 due to unqualified use of 'Point'
@@ -6270,9 +6273,6 @@ void QgisApp::namUpdate()
62706273

62716274
#if QT_VERSION >= 0x40500
62726275
mNAM->setProxyFactory( new QgsNetworkProxyFactory( proxy, excludes ) );
6273-
#else
6274-
mNAM->setProxy( proxy );
6275-
#endif
62766276

62776277
QNetworkDiskCache *cache = qobject_cast<QNetworkDiskCache*>( nam()->cache() );
62786278
if ( !cache )
@@ -6289,4 +6289,7 @@ void QgisApp::namUpdate()
62896289

62906290
if ( mNAM->cache() != cache )
62916291
mNAM->setCache( cache );
6292+
#else
6293+
mNAM->setProxy( proxy );
6294+
#endif
62926295
}

src/app/qgsoptions.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929
#include <QColorDialog>
3030
#include <QLocale>
3131
#include <QNetworkAccessManager>
32+
33+
#if QT_VERSION >= 0x40500
3234
#include <QNetworkDiskCache>
35+
#endif
3336

3437
#include <limits>
3538
#include <sqlite3.h>
@@ -116,10 +119,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
116119
}
117120
}
118121

119-
#if QT_VERSION < 0x40500
120-
grpUrlExclude->setHidden( true );
121-
#endif
122-
122+
#if QT_VERSION >= 0x40500
123123
// cache settings
124124
QNetworkDiskCache *cache = qobject_cast<QNetworkDiskCache*>( QgisApp::instance()->nam()->cache() );
125125
if ( cache )
@@ -131,6 +131,10 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
131131
QgsDebugMsg( QString( "set cacheSize: %1" ).arg( cache->maximumCacheSize() ) );
132132
mCacheSize->setValue( cache->maximumCacheSize() / 1024 );
133133
}
134+
#else
135+
grpUrlExclude->setHidden( true );
136+
grpCache->setHidden( true );
137+
#endif
134138

135139
//wms search server
136140
leWmsSearch->setText( settings.value( "/qgis/WMSSearchUrl", "http://geopole.org/wms/search?search=%1&type=rss" ).toString() );
@@ -868,5 +872,7 @@ void QgsOptions::on_mBrowseCacheDirectory_clicked()
868872

869873
void QgsOptions::on_mClearCache_clicked()
870874
{
875+
#if QT_VERSION >= 0x40500
871876
QgisApp::instance()->nam()->cache()->clear();
877+
#endif
872878
}

src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ QList<QString> QgsPointDisplacementRenderer::usedAttributes()
238238
}
239239
if ( mRenderer )
240240
{
241-
attributeList.append( mRenderer->usedAttributes() );
241+
attributeList += mRenderer->usedAttributes();
242242
}
243243
return attributeList;
244244
}

src/plugins/point_displacement_renderer/qgspointdisplacementrendererwidget.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,11 @@ void QgsPointDisplacementRendererWidget::on_mCircleColorButton_clicked()
224224
return;
225225
}
226226

227+
#if QT_VERSION >= 0x040500
227228
QColor newColor = QColorDialog::getColor( mRenderer->circleColor(), 0, tr( "Circle color" ), QColorDialog::ShowAlphaChannel );
229+
#else
230+
QColor newColor = QColorDialog::getColor( mRenderer->circleColor() );
231+
#endif
228232
if ( newColor.isValid() )
229233
{
230234
mRenderer->setCircleColor( newColor );
@@ -239,7 +243,11 @@ void QgsPointDisplacementRendererWidget::on_mLabelColorButton_clicked()
239243
return;
240244
}
241245

246+
#if QT_VERSION >= 0x040500
242247
QColor newColor = QColorDialog::getColor( mRenderer->labelColor(), 0, tr( "Label color" ), QColorDialog::ShowAlphaChannel );
248+
#else
249+
QColor newColor = QColorDialog::getColor( mRenderer->labelColor() );
250+
#endif
243251
if ( newColor.isValid() )
244252
{
245253
mRenderer->setLabelColor( newColor );

src/providers/wms/qgswmsprovider.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@
3535
#include <QNetworkAccessManager>
3636
#include <QNetworkRequest>
3737
#include <QNetworkReply>
38-
#include <QNetworkDiskCache>
3938
#include <QNetworkProxy>
4039

40+
#if QT_VERSION >= 0x40500
41+
#include <QNetworkDiskCache>
42+
#endif
43+
4144
#include <QUrl>
4245
#include <QImage>
4346
#include <QPainter>
@@ -105,6 +108,7 @@ QgsWmsProvider::QgsWmsProvider( QString const &uri )
105108
}
106109
}
107110

111+
#if QT_VERSION >= 0x40500
108112
if ( !smNAM )
109113
{
110114
QgsDebugMsg( "application doesn't have a network access manager - creating wmscache" );
@@ -113,6 +117,7 @@ QgsWmsProvider::QgsWmsProvider( QString const &uri )
113117
ndc->setCacheDirectory( "wmsCache" );
114118
smNAM->setCache( ndc );
115119
}
120+
#endif
116121
}
117122

118123
// URL may contain username/password information for a WMS
@@ -670,11 +675,13 @@ void QgsWmsProvider::tileReplyFinished()
670675
{
671676
QNetworkReply *reply = qobject_cast<QNetworkReply*>( sender() );
672677

678+
#if QT_VERSION >= 0x40500
673679
bool fromCache = reply->attribute( QNetworkRequest::SourceIsFromCacheAttribute ).toBool();
674680
if ( fromCache )
675681
mCacheHits++;
676682
else
677683
mCacheMisses++;
684+
#endif
678685
int tileReqNo = reply->request().attribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 0 ) ).toInt();
679686
int tileNo = reply->request().attribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 1 ) ).toInt();
680687
QRectF r = reply->request().attribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 2 ) ).toRectF();

src/ui/qgsoptionsbase.ui

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<x>0</x>
88
<y>0</y>
99
<width>813</width>
10-
<height>565</height>
10+
<height>605</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -1407,7 +1407,7 @@
14071407
</widget>
14081408
</item>
14091409
<item>
1410-
<widget class="QGroupBox" name="groupBox_4">
1410+
<widget class="QGroupBox" name="grpCache">
14111411
<property name="title">
14121412
<string>Cache settings</string>
14131413
</property>

0 commit comments

Comments
 (0)