Skip to content
Permalink
Browse files

remove remaining QT_VERSION <=> 5 checks (also fixes b3e8d82)

  • Loading branch information
jef-n committed Jan 25, 2017
1 parent 01004d9 commit 43faf338f3147382fe7e885d82336ce40e48da41
File renamed without changes.
@@ -18,13 +18,8 @@


#include <QtGlobal>
#if QT_VERSION < 0x050000
#include <QDesignerCustomWidgetCollectionInterface>
#include <QDesignerExportWidget>
#else
#include <QtUiPlugin/QDesignerCustomWidgetInterface>
#include <QtUiPlugin/QDesignerExportWidget>
#endif


class CUSTOMWIDGETS_EXPORT %CLASSMIXEDCASE%Plugin : public QObject, public QDesignerCustomWidgetInterface
@@ -26,7 +26,7 @@ declare -a EXT=("cpp" "h")
for i in "${EXT[@]}"
do
DESTFILE=$DIR/../src/customwidgets/${CLASSLOWER}plugin.$i
cp $DIR/customwidget_template.$i $DESTFILE
cp $DIR/customwidget.$i.template $DESTFILE
sed -i s/%DATE%/"$TODAY"/g "$DESTFILE"
sed -i s/%YEAR%/"$YEAR"/g "$DESTFILE"
sed -i s/%AUTHOR%/"$AUTHOR"/g "$DESTFILE"
@@ -63,8 +63,3 @@ QList<QDesignerCustomWidgetInterface*> QgisCustomWidgets::customWidgets() const
{
return mWidgets;
}

Q_EXPORT_PLUGIN2( customwidgetsplugin, QgisCustomWidgets )



@@ -68,9 +68,4 @@ QStringList QOCISpatialDriverPlugin::keys() const
return l;
}

#if QT_VERSION < 0x050000
Q_EXPORT_STATIC_PLUGIN( QOCISpatialDriverPlugin )
Q_EXPORT_PLUGIN2( qsqlocispatial, QOCISpatialDriverPlugin )
#endif

QT_END_NAMESPACE
@@ -47,10 +47,6 @@
#include <QSqlDriverPlugin>
#include <QStringList>

#if QT_VERSION < 0x050000
#define Q_PLUGIN_METADATA(x)
#endif

class QOCISpatialDriverPlugin : public QSqlDriverPlugin
{
Q_OBJECT
@@ -94,10 +94,8 @@
#define QOCISPATIAL_THREADED


#if QT_VERSION >= 0x050000
Q_DECLARE_OPAQUE_POINTER( OCIEnv* )
Q_DECLARE_OPAQUE_POINTER( OCIStmt* )
#endif
Q_DECLARE_METATYPE( OCIEnv* )
Q_DECLARE_METATYPE( OCIStmt* )

@@ -3255,23 +3253,6 @@ QVariant QOCISpatialResult::lastInsertId() const
return QVariant();
}

void QOCISpatialResult::virtual_hook( int id, void *data )
{
ENTER
Q_ASSERT( data );

switch ( id )
{
#if QT_VERSION < 0x050000
case QSqlResult::BatchOperation:
QOCISpatialCols::execBatch( d, boundValues(), *reinterpret_cast<bool *>( data ) );
break;
#endif
default:
QSqlCachedResult::virtual_hook( id, data );
}
}

////////////////////////////////////////////////////////////////////////////


@@ -3356,9 +3337,7 @@ bool QOCISpatialDriver::hasFeature( DriverFeature f ) const
case EventNotifications:
case FinishQuery:
case MultipleResultSets:
#if QT_VERSION >= 0x050000
case CancelQuery:
#endif
return false;
case Unicode:
return d->serverVersion >= 9;
@@ -83,7 +83,6 @@ class Q_EXPORT_SQLDRIVER_OCISPATIAL QOCISpatialResult : public QSqlCachedResult
int numRowsAffected();
QSqlRecord record() const;
QVariant lastInsertId() const;
void virtual_hook( int id, void *data );

private:
QOCISpatialResultPrivate *d;
@@ -271,86 +271,6 @@ QString QgsOracleProvider::storageType() const
return "Oracle database with locator/spatial extension";
}

#if QT_VERSION < 0x050000
static bool operator<( const QVariant &a, const QVariant &b )
{
if ( a.isNull() || b.isNull() )
return false;

if ( a.type() == b.type() )
{
switch ( a.type() )
{
case QVariant::Int:
case QVariant::Char:
return a.toInt() < b.toInt();

case QVariant::Double:
return a.toDouble() < b.toDouble();

case QVariant::LongLong:
return a.toLongLong() < b.toLongLong();

case QVariant::List:
{
QList<QVariant> al = a.toList();
QList<QVariant> bl = b.toList();

int i, n = qMin( al.size(), bl.size() );
for ( i = 0; i < n && al[i] == bl[i]; i++ )
;

if ( i == n )
return al.size() < bl.size();
else
return al[i] < bl[i];
}
break;

case QVariant::StringList:
{
QStringList al = a.toStringList();
QStringList bl = b.toStringList();

int i, n = qMin( al.size(), bl.size() );
for ( i = 0; i < n && al[i] == bl[i]; i++ )
;

if ( i == n )
return al.size() < bl.size();
else
return al[i] < bl[i];
}
break;

case QVariant::Date:
return a.toDate() < b.toDate();

case QVariant::Time:
return a.toTime() < b.toTime();

case QVariant::DateTime:
return a.toDateTime() < b.toDateTime();

case QVariant::Bool:
return a.toBool() < b.toBool();

case QVariant::UInt:
return a.toUInt() < b.toUInt();

case QVariant::ULongLong:
return a.toULongLong() < b.toULongLong();

default:
break;
}
}

return a.canConvert( QVariant::String ) && b.canConvert( QVariant::String ) && a.toString() < b.toString();
}
#endif


QString QgsOracleProvider::pkParamWhereClause() const
{
QString whereClause;
@@ -333,7 +333,7 @@ QString QgsPostgresProvider::storageType() const
return QStringLiteral( "PostgreSQL database with PostGIS extension" );
}

#if QT_VERSION >= 0x050000 && QT_VERSION < 0x050600
#if QT_VERSION < 0x050600
#include <algorithm>
template <typename T>
bool operator<( const QList<T> &lhs, const QList<T> &rhs )
@@ -60,10 +60,8 @@
#include <sqlite3.h>
#include <qgsslconnect.h>

#if QT_VERSION >= 0x050000
Q_DECLARE_OPAQUE_POINTER(sqlite3*)
Q_DECLARE_OPAQUE_POINTER(sqlite3_stmt*)
#endif
Q_DECLARE_METATYPE(sqlite3*)
Q_DECLARE_METATYPE(sqlite3_stmt*)

@@ -326,20 +324,6 @@ QSpatiaLiteResult::~QSpatiaLiteResult()
delete d;
}

void QSpatiaLiteResult::virtual_hook(int id, void *data)
{
switch (id) {
#if QT_VERSION < 0x050000
case QSqlResult::DetachFromResultSet:
if (d->stmt)
sqlite3_reset(d->stmt);
break;
#endif
default:
QSqlCachedResult::virtual_hook(id, data);
}
}

bool QSpatiaLiteResult::reset(const QString &query)
{
if (!prepare(query))
@@ -491,13 +475,11 @@ QSqlRecord QSpatiaLiteResult::record() const
return d->rInf;
}

#if QT_VERSION >= 0x050000
void QSpatiaLiteResult::detachFromResultSet()
{
if (d->stmt)
sqlite3_reset(d->stmt);
}
#endif

QVariant QSpatiaLiteResult::handle() const
{
@@ -545,9 +527,7 @@ bool QSpatiaLiteDriver::hasFeature(DriverFeature f) const
case BatchOperations:
case EventNotifications:
case MultipleResultSets:
#if QT_VERSION >= 0x050000
case CancelQuery:
#endif
return false;
}
return false;
@@ -80,10 +80,7 @@ class QSpatiaLiteResult : public QSqlCachedResult
int numRowsAffected();
QVariant lastInsertId() const;
QSqlRecord record() const;
#if QT_VERSION >= 0x050000
void detachFromResultSet();
#endif
void virtual_hook(int id, void *data);

private:
QSpatiaLiteResultPrivate* d;
@@ -62,8 +62,3 @@ QStringList QSpatiaLiteDriverPlugin::keys() const
l << QLatin1String("QSPATIALITE");
return l;
}

#if QT_VERSION < 0x050000
Q_EXPORT_STATIC_PLUGIN( QSpatiaLiteDriverPlugin )
Q_EXPORT_PLUGIN2( qspatialite, QSpatiaLiteDriverPlugin )
#endif
@@ -45,9 +45,6 @@
#include <QSqlDriverPlugin>
#include <QStringList>

#if QT_VERSION < 0x050000
#define Q_PLUGIN_METADATA(x)
#endif

class QSpatiaLiteDriverPlugin : public QSqlDriverPlugin
{
@@ -17,10 +17,6 @@

#include "qgis.h"
#include "qgsremotedatasourcebuilder.h"
#if QT_VERSION < 0x050000
#include "qgsftptransaction.h"
#include "qgshttptransaction.h"
#endif
#include "qgslogger.h"
#include "qgsrasterlayer.h"
#include "qgsvectorlayer.h"
@@ -158,30 +154,8 @@ QgsVectorLayer* QgsRemoteDataSourceBuilder::vectorLayerFromRemoteVDS( const QDom

int QgsRemoteDataSourceBuilder::loadData( const QString& url, QByteArray& data ) const
{
#if QT_VERSION < 0x050000
if ( url.startsWith( "http", Qt::CaseInsensitive ) )
{
QgsHttpTransaction http( url );
if ( !http.getSynchronously( data ) )
{
QgsDebugMsg( "Error, loading from http failed" );
return 1; //no success
}
}
else if ( url.startsWith( "ftp", Qt::CaseInsensitive ) )
{
Q_NOWARN_DEPRECATED_PUSH;
QgsFtpTransaction ftp;
if ( ftp.get( url, data ) != 0 )
{
return 1;
}
Q_NOWARN_DEPRECATED_POP;
}
#else
Q_UNUSED( url )
Q_UNUSED( data )
QgsDebugMsg( "http and ftp remote datasources not supported with Qt5" );
#endif
return 0;
}

0 comments on commit 43faf33

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