Skip to content
Permalink
Browse files
resolve Qt 4.5 dependency
git-svn-id: http://svn.osgeo.org/qgis/trunk@13447 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed May 9, 2010
1 parent dec81b9 commit 4ab3c745924f80be5dbf56f3f8ab1b67b03695ac
@@ -35,6 +35,10 @@ IF(MSVC)
ADD_DEFINITIONS(-DNOMINMAX)
ENDIF(MSVC)

MATH(EXPR QT_VERSION "${QT_VERSION_MAJOR}*10000 + ${QT_VERSION_MINOR}*100")
IF(QT_VERSION LESS 40500)
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} PROXY_FACTORY)
ENDIF(QT_VERSION LESS 40500)

# core module
FILE(GLOB sip_files_core core/*.sip)
@@ -16,29 +16,31 @@
*
*/

%Feature PROXY_FACTORY

class QgsNetworkAccessManager : QNetworkAccessManager
{
%TypeHeaderCode
#include <qgsnetworkaccessmanager.h>
%End
//! returns a point to the single instance
public:
//! returns a pointer to the single instance
// and creates that instance on the first call.
static QgsNetworkAccessManager *instance();

//! destructor
~QgsNetworkAccessManager();

%If (PROXY_FACTORY)
//! insert a factory into the proxy factories list
void insertProxyFactory(QNetworkProxyFactory *factory /TransferTo/);

//! remove a factory from the proxy factories list
void removeProxyFactory(QNetworkProxyFactory *factory /TransferBack/);

//! retrieve proxy factory list
void setDiskCache( QString directory, qint64 size );

//! retrieve fall back proxy (for urls that no factory returned proxies for)
const QList<QNetworkProxyFactory *> proxyFactories() const;
%End

//! retrieve exclude list (urls shouldn't use the fallback proxy)
const QStringList &excludeList() const;
@@ -25,6 +25,7 @@

#include <QUrl>

#if QT_VERSION >= 0x40500
class QgsNetworkProxyFactory : public QNetworkProxyFactory
{
public:
@@ -62,6 +63,7 @@ class QgsNetworkProxyFactory : public QNetworkProxyFactory
return QList<QNetworkProxy>() << nam->fallbackProxy();
}
};
#endif

QgsNetworkAccessManager *QgsNetworkAccessManager::smNAM = 0;

@@ -78,13 +80,16 @@ QgsNetworkAccessManager *QgsNetworkAccessManager::instance()
QgsNetworkAccessManager::QgsNetworkAccessManager( QObject *parent )
: QNetworkAccessManager( parent )
{
#if QT_VERSION >= 0x40500
setProxyFactory( new QgsNetworkProxyFactory() );
#endif
}

QgsNetworkAccessManager::~QgsNetworkAccessManager()
{
}

#if QT_VERSION >= 0x40500
void QgsNetworkAccessManager::insertProxyFactory( QNetworkProxyFactory *factory )
{
mProxyFactories.insert( 0, factory );
@@ -99,6 +104,7 @@ const QList<QNetworkProxyFactory *> QgsNetworkAccessManager::proxyFactories() co
{
return mProxyFactories;
}
#endif

const QStringList &QgsNetworkAccessManager::excludeList() const
{
@@ -46,13 +46,14 @@ class CORE_EXPORT QgsNetworkAccessManager : public QNetworkAccessManager
Q_OBJECT

public:
//! returns a point to the single instance
//! returns a pointer to the single instance
// and creates that instance on the first call.
static QgsNetworkAccessManager *instance();

//! destructor
~QgsNetworkAccessManager();

#if QT_VERSION >= 0x40500
//! insert a factory into the proxy factories list
void insertProxyFactory( QNetworkProxyFactory *factory );

@@ -61,6 +62,7 @@ class CORE_EXPORT QgsNetworkAccessManager : public QNetworkAccessManager

//! retrieve proxy factory list
const QList<QNetworkProxyFactory *> proxyFactories() const;
#endif

//! retrieve fall back proxy (for urls that no factory returned proxies for)
const QNetworkProxy &fallbackProxy() const;
@@ -73,7 +75,9 @@ class CORE_EXPORT QgsNetworkAccessManager : public QNetworkAccessManager

private:
QgsNetworkAccessManager( QObject *parent = 0 );
#if QT_VERSION >= 0x40500
QList<QNetworkProxyFactory*> mProxyFactories;
#endif
QNetworkProxy mFallbackProxy;
QStringList mExcludedURLs;

@@ -239,6 +239,9 @@ void QgsSpatialQuery::execQuery( QSet<int> & qsetIndexResult, int relation )
case Intersects:
operation = &QgsGeometry::intersects;
break;
default:
qWarning( "undefined operation" );
return;
}

// Transform referencer Target = Reference

0 comments on commit 4ab3c74

Please sign in to comment.