Skip to content
Permalink
Browse files

remove Qt 4.5 dependencies

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13143 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Mar 22, 2010
1 parent b04de49 commit 1b4be693fb740fc66308dcd968088117b585a573
@@ -68,11 +68,14 @@
#include <QWhatsThis>

#include <QNetworkAccessManager>
#include <QNetworkDiskCache>
#include <QNetworkReply>
#include <QNetworkProxy>
#include <QAuthenticator>

#if QT_VERSION >= 0x40500
#include <QNetworkDiskCache>
#endif

//
// Mac OS X Includes
// Must include before GEOS 3 due to unqualified use of 'Point'
@@ -6270,9 +6273,6 @@ void QgisApp::namUpdate()

#if QT_VERSION >= 0x40500
mNAM->setProxyFactory( new QgsNetworkProxyFactory( proxy, excludes ) );
#else
mNAM->setProxy( proxy );
#endif

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

if ( mNAM->cache() != cache )
mNAM->setCache( cache );
#else
mNAM->setProxy( proxy );
#endif
}
@@ -29,7 +29,10 @@
#include <QColorDialog>
#include <QLocale>
#include <QNetworkAccessManager>

#if QT_VERSION >= 0x40500
#include <QNetworkDiskCache>
#endif

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

#if QT_VERSION < 0x40500
grpUrlExclude->setHidden( true );
#endif

#if QT_VERSION >= 0x40500
// cache settings
QNetworkDiskCache *cache = qobject_cast<QNetworkDiskCache*>( QgisApp::instance()->nam()->cache() );
if ( cache )
@@ -131,6 +131,10 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
QgsDebugMsg( QString( "set cacheSize: %1" ).arg( cache->maximumCacheSize() ) );
mCacheSize->setValue( cache->maximumCacheSize() / 1024 );
}
#else
grpUrlExclude->setHidden( true );
grpCache->setHidden( true );
#endif

//wms search server
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()

void QgsOptions::on_mClearCache_clicked()
{
#if QT_VERSION >= 0x40500
QgisApp::instance()->nam()->cache()->clear();
#endif
}
@@ -238,7 +238,7 @@ QList<QString> QgsPointDisplacementRenderer::usedAttributes()
}
if ( mRenderer )
{
attributeList.append( mRenderer->usedAttributes() );
attributeList += mRenderer->usedAttributes();
}
return attributeList;
}
@@ -224,7 +224,11 @@ void QgsPointDisplacementRendererWidget::on_mCircleColorButton_clicked()
return;
}

#if QT_VERSION >= 0x040500
QColor newColor = QColorDialog::getColor( mRenderer->circleColor(), 0, tr( "Circle color" ), QColorDialog::ShowAlphaChannel );
#else
QColor newColor = QColorDialog::getColor( mRenderer->circleColor() );
#endif
if ( newColor.isValid() )
{
mRenderer->setCircleColor( newColor );
@@ -239,7 +243,11 @@ void QgsPointDisplacementRendererWidget::on_mLabelColorButton_clicked()
return;
}

#if QT_VERSION >= 0x040500
QColor newColor = QColorDialog::getColor( mRenderer->labelColor(), 0, tr( "Label color" ), QColorDialog::ShowAlphaChannel );
#else
QColor newColor = QColorDialog::getColor( mRenderer->labelColor() );
#endif
if ( newColor.isValid() )
{
mRenderer->setLabelColor( newColor );
@@ -35,9 +35,12 @@
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QNetworkDiskCache>
#include <QNetworkProxy>

#if QT_VERSION >= 0x40500
#include <QNetworkDiskCache>
#endif

#include <QUrl>
#include <QImage>
#include <QPainter>
@@ -105,6 +108,7 @@ QgsWmsProvider::QgsWmsProvider( QString const &uri )
}
}

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

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

#if QT_VERSION >= 0x40500
bool fromCache = reply->attribute( QNetworkRequest::SourceIsFromCacheAttribute ).toBool();
if ( fromCache )
mCacheHits++;
else
mCacheMisses++;
#endif
int tileReqNo = reply->request().attribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 0 ) ).toInt();
int tileNo = reply->request().attribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 1 ) ).toInt();
QRectF r = reply->request().attribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 2 ) ).toRectF();
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>813</width>
<height>565</height>
<height>605</height>
</rect>
</property>
<property name="windowTitle">
@@ -1407,7 +1407,7 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_4">
<widget class="QGroupBox" name="grpCache">
<property name="title">
<string>Cache settings</string>
</property>

0 comments on commit 1b4be69

Please sign in to comment.
You can’t perform that action at this time.