Skip to content

Commit

Permalink
resolve Qt 4.5 dependency
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13447 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed May 9, 2010
1 parent 4b0d385 commit cfd52d0
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
4 changes: 4 additions & 0 deletions python/CMakeLists.txt
Expand Up @@ -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)
Expand Down
10 changes: 6 additions & 4 deletions python/core/qgsnetworkaccessmanager.sip
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions src/core/qgsnetworkaccessmanager.cpp
Expand Up @@ -25,6 +25,7 @@

#include <QUrl>

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

QgsNetworkAccessManager *QgsNetworkAccessManager::smNAM = 0;

Expand All @@ -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 );
Expand All @@ -99,6 +104,7 @@ const QList<QNetworkProxyFactory *> QgsNetworkAccessManager::proxyFactories() co
{
return mProxyFactories;
}
#endif

const QStringList &QgsNetworkAccessManager::excludeList() const
{
Expand Down
6 changes: 5 additions & 1 deletion src/core/qgsnetworkaccessmanager.h
Expand Up @@ -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 );

Expand All @@ -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;
Expand All @@ -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;

Expand Down
3 changes: 3 additions & 0 deletions src/plugins/spatialquery/qgsspatialquery.cpp
Expand Up @@ -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
Expand Down

0 comments on commit cfd52d0

Please sign in to comment.