Skip to content

Commit

Permalink
fix build with older Qt
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Feb 18, 2013
1 parent 2225690 commit ee96d38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/providers/spatialite/qspatialite/qsql_spatialite.cpp
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -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() ) );
Expand Down

0 comments on commit ee96d38

Please sign in to comment.