Skip to content

Commit

Permalink
Merge pull request #44219 from nirvn/qt6_11
Browse files Browse the repository at this point in the history
[qt6] Fix compilation of gpx and db2 providers against qt6
  • Loading branch information
nirvn committed Jul 18, 2021
2 parents 8510650 + 194dac6 commit 9f816de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/providers/db2/qgsdb2provider.cpp
Expand Up @@ -1138,8 +1138,8 @@ bool QgsDb2Provider::addFeatures( QgsFeatureList &flist, Flags flags )
query.bindValue( bindIdx, bytea, QSql::In | QSql::Binary );
}

// Show bound values
#if 0
// Show bound values
QList<QVariant> list = query.boundValues().values();

for ( int i = 0; i < list.size(); ++i )
Expand Down Expand Up @@ -1576,13 +1576,15 @@ Qgis::VectorExportResult QgsDb2Provider::createEmptyLayer( const QString &uri,
}
}

#if 0
// Show bound values
QList<QVariant> list = query.boundValues().values();
for ( int i = 0; i < list.size(); ++i )
{
QgsDebugMsg( QStringLiteral( "i: %1; value: %2; type: %3" )
.arg( i ).arg( list.at( i ).toString().toLatin1().data(), list.at( i ).typeName() ) );
}

#endif
}
// clear any resources hold by the query
q.clear();
Expand Down
6 changes: 4 additions & 2 deletions src/providers/gpx/gpsdata.cpp
Expand Up @@ -349,7 +349,9 @@ void QgsGpsData::removeTracks( const QgsFeatureIds &ids )

void QgsGpsData::writeXml( QTextStream &stream )
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
stream.setCodec( QTextCodec::codecForName( "UTF8" ) );
#endif
stream << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
<< "<gpx version=\"1.0\" creator=\"QGIS\">\n";
for ( WaypointIterator wIter = waypoints.begin();
Expand All @@ -360,7 +362,7 @@ void QgsGpsData::writeXml( QTextStream &stream )
for ( TrackIterator tIter = tracks.begin(); tIter != tracks.end(); ++tIter )
tIter->writeXml( stream );
stream << "</gpx>\n";
stream << flush;
stream.flush();
}


Expand Down Expand Up @@ -409,7 +411,7 @@ QgsGpsData *QgsGpsData::getData( const QString &fileName )

data->setNoDataExtent();

dataObjects[fileName] = qMakePair<QgsGpsData *, unsigned>( data, 0 );
dataObjects[fileName] = qMakePair( data, 0 );
}
else
{
Expand Down

0 comments on commit 9f816de

Please sign in to comment.