Skip to content
Permalink
Browse files
fix build with older Qt
  • Loading branch information
jef-n committed Feb 18, 2013
1 parent 2225690 commit ee96d381e2a97054848dcb38ffb8f8c66ccdb4b2
Showing with 8 additions and 7 deletions.
  1. +4 −7 src/providers/spatialite/qspatialite/qsql_spatialite.cpp
  2. +4 −0 src/providers/wms/qgswmsprovider.cpp
@@ -97,7 +97,7 @@ static QSqlError qMakeError(sqlite3 *access, const QString &descr, QSqlError::Er
int errorCode = -1)
{
return QSqlError(descr,
QString(reinterpret_cast<const QChar *>(sqlite3_errmsg16(access))),
QString::fromUtf16( (const ushort *) sqlite3_errmsg16(access) ),
type, errorCode);
}

@@ -165,13 +165,10 @@ void QSpatiaLiteResultPrivate::initColumns(bool emptyResultset)
q->init(nCols);

for (int i = 0; i < nCols; ++i) {
QString colName = QString(reinterpret_cast<const QChar *>(
sqlite3_column_name16(stmt, i))
).remove(QLatin1Char('"'));
QString colName = QString::fromUtf16( (const ushort *) sqlite3_column_name16(stmt, i) ).remove(QLatin1Char('"'));

// must use typeName for resolving the type to match QSqliteDriver::record
QString typeName = QString(reinterpret_cast<const QChar *>(
sqlite3_column_decltype16(stmt, i)));
QString typeName = QString::fromUtf16( (const ushort *) sqlite3_column_decltype16(stmt, i) );
// sqlite3_column_type is documented to have undefined behavior if the result set is empty
int stp = emptyResultset ? -1 : sqlite3_column_type(stmt, i);

@@ -369,7 +366,7 @@ bool QSpatiaLiteResult::prepare(const QString &query)
"Unable to execute statement"), QSqlError::StatementError, res));
d->finalize();
return false;
} else if (pzTail && !QString(reinterpret_cast<const QChar *>(pzTail)).trimmed().isEmpty()) {
} else if (pzTail && !QString::fromUtf16( (const ushort *) pzTail ).trimmed().isEmpty()) {
setLastError(qMakeError(d->access, QCoreApplication::translate("QSpatiaLiteResult",
"Unable to execute multiple statements at a time"), QSqlError::StatementError, SQLITE_MISUSE));
d->finalize();
@@ -4187,7 +4187,11 @@ QMap<int, QVariant> QgsWmsProvider::identify( const QgsPoint & thePoint, Identif
QgsGml gml( featureTypeName, geometryAttribute, fields );
// TODO: avoid converting to string and back
int ret = gml.getFeatures( mIdentifyResultBodies.value( gmlPart ), &wkbType );
#ifdef QGISDEBUG
QgsDebugMsg( QString( "parsing result = %1" ).arg( ret ) );
#else
Q_UNUSED( ret );
#endif

QMap<QgsFeatureId, QgsFeature* > features = gml.featuresMap();
QgsDebugMsg( QString( "%1 features read" ).arg( features.size() ) );

0 comments on commit ee96d38

Please sign in to comment.