summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-14 23:45:53 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-14 23:45:53 (GMT)
commit0e144849eb2f8918c3a2d6e91aee2c84aea787a8 (patch)
tree5169cc77630220e7ff5dae1a7c709173bcbc5f02
parent570a430b12409a5462554c35fda2bcf51576d14d (diff)
Use -DQT_NO_CAST_FROM_BYTEARRAY (and adapt some code)
-rw-r--r--CMakeLists.txt1
-rw-r--r--src/lib/marble/AbstractDataPlugin.cpp2
-rw-r--r--src/lib/marble/AbstractDataPluginModel.cpp2
-rw-r--r--src/lib/marble/MapThemeManager.cpp8
-rw-r--r--src/lib/marble/MarbleLegendBrowser.cpp2
-rw-r--r--src/lib/marble/TileCreatorDialog.cpp2
-rw-r--r--src/lib/marble/declarative/DeclarativeDataPlugin.cpp2
-rw-r--r--src/plugins/render/opencachingcom/OpenCachingComItem.cpp6
-rw-r--r--src/plugins/runner/osm/translators/O5mWriter.cpp12
-rw-r--r--tests/AbstractDataPluginTest.cpp2
-rw-r--r--tests/AbstractFloatItemTest.cpp9
-rw-r--r--tests/RenderPluginTest.cpp26
-rw-r--r--tests/TestGeoDataCoordinates.cpp4
-rw-r--r--tests/TestGeoDataWriter.cpp2
-rw-r--r--tests/TestGeoSceneWriter.cpp8
15 files changed, 51 insertions, 37 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ae9236d..d1026c8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -219,6 +219,7 @@ add_definitions(
-DQT_USE_QSTRINGBUILDER
-DQT_NO_SIGNALS_SLOTS_KEYWORDS
-DQT_NO_URL_CAST_FROM_STRING
+ -DQT_NO_CAST_FROM_BYTEARRAY
-DQT_STRICT_ITERATORS
)
diff --git a/src/lib/marble/AbstractDataPlugin.cpp b/src/lib/marble/AbstractDataPlugin.cpp
index a594e40..14f7894 100644
--- a/src/lib/marble/AbstractDataPlugin.cpp
+++ b/src/lib/marble/AbstractDataPlugin.cpp
@@ -213,7 +213,7 @@ void AbstractDataPlugin::handleViewportChange( const ViewportParams *viewport )
context->setContextObject( item );
QList<QByteArray> const dynamicProperties = item->dynamicPropertyNames();
foreach( const QByteArray &property, dynamicProperties ) {
- context->setContextProperty( property, item->property( property ) );
+ context->setContextProperty(property, item->property(property.constData()));
}
QObject* component = d->m_delegate->create( context );
diff --git a/src/lib/marble/AbstractDataPluginModel.cpp b/src/lib/marble/AbstractDataPluginModel.cpp
index 99f41a5..e35411f 100644
--- a/src/lib/marble/AbstractDataPluginModel.cpp
+++ b/src/lib/marble/AbstractDataPluginModel.cpp
@@ -228,7 +228,7 @@ QVariant FavoritesModel::data( const QModelIndex &index, int role ) const
if ( item->initialized() && item->isFavorite() ) {
if ( count == row ) {
QString const roleName = roleNames().value( role );
- return item->property( roleName.toLatin1() );
+ return item->property(roleName.toLatin1().constData());
}
++count;
}
diff --git a/src/lib/marble/MapThemeManager.cpp b/src/lib/marble/MapThemeManager.cpp
index d2029a6..e0bc6ee 100644
--- a/src/lib/marble/MapThemeManager.cpp
+++ b/src/lib/marble/MapThemeManager.cpp
@@ -385,15 +385,15 @@ QList<QStandardItem *> MapThemeManager::Private::createMapThemeRow( QString cons
QIcon mapThemeIcon = QIcon( themeIconPixmap );
QString name = mapTheme->head()->name();
- QString description = mapTheme->head()->description();
+ const QByteArray description = mapTheme->head()->description().toUtf8();
QStandardItem *item = new QStandardItem( name );
- item->setData( QCoreApplication::translate("DGML", name.toUtf8() ), Qt::DisplayRole );
+ item->setData(QCoreApplication::translate("DGML", name.toUtf8().constData()), Qt::DisplayRole);
item->setData( mapThemeIcon, Qt::DecorationRole );
item->setData( QString( "<span style=\" max-width: 150 px;\"> "
- + QCoreApplication::translate("DGML", description.toUtf8() ) + " </span>" ), Qt::ToolTipRole );
+ + QCoreApplication::translate("DGML", description.constData()) + " </span>"), Qt::ToolTipRole );
item->setData( mapThemeID, Qt::UserRole + 1 );
- item->setData( QCoreApplication::translate("DGML", description.toUtf8() ), Qt::UserRole + 2 );
+ item->setData(QCoreApplication::translate("DGML", description.constData()), Qt::UserRole + 2);
itemList << item;
diff --git a/src/lib/marble/MarbleLegendBrowser.cpp b/src/lib/marble/MarbleLegendBrowser.cpp
index df75c5f..bd4b3be 100644
--- a/src/lib/marble/MarbleLegendBrowser.cpp
+++ b/src/lib/marble/MarbleLegendBrowser.cpp
@@ -251,7 +251,7 @@ void MarbleLegendBrowser::translateHtml( QString & html )
QStringList::const_iterator i = words.constBegin();
QStringList::const_iterator const end = words.constEnd();
for (; i != end; ++i )
- html.replace( *i, QCoreApplication::translate("Legends", (*i).toUtf8() ) );
+ html.replace(*i, QCoreApplication::translate("Legends", (*i).toUtf8().constData()));
}
void MarbleLegendBrowser::reverseSupportCheckboxes(QString &html)
diff --git a/src/lib/marble/TileCreatorDialog.cpp b/src/lib/marble/TileCreatorDialog.cpp
index 74a5d98..be51d2a 100644
--- a/src/lib/marble/TileCreatorDialog.cpp
+++ b/src/lib/marble/TileCreatorDialog.cpp
@@ -84,7 +84,7 @@ void TileCreatorDialog::setProgress( int progress )
void TileCreatorDialog::setSummary( const QString& name,
const QString& description )
{
- const QString summary = "<B>" + QCoreApplication::translate("DGML", name.toUtf8() ) + "</B><BR>" + QCoreApplication::translate("DGML", description.toUtf8() );
+ const QString summary = "<b>" + QCoreApplication::translate("DGML", name.toUtf8().constData()) + "</b><br>" + QCoreApplication::translate("DGML", description.toUtf8().constData());
d->uiWidget.descriptionLabel->setText( summary );
}
diff --git a/src/lib/marble/declarative/DeclarativeDataPlugin.cpp b/src/lib/marble/declarative/DeclarativeDataPlugin.cpp
index 7e1e481..6c5a0f3 100644
--- a/src/lib/marble/declarative/DeclarativeDataPlugin.cpp
+++ b/src/lib/marble/declarative/DeclarativeDataPlugin.cpp
@@ -74,7 +74,7 @@ void DeclarativeDataPluginPrivate::parseChunk( DeclarativeDataPluginItem *item,
} else if( key == "alt" || key == "altitude" ) {
coordinates.setAltitude( value.toDouble() );
} else {
- item->setProperty( key.toLatin1(), value );
+ item->setProperty(key.toLatin1().constData(), value);
}
}
diff --git a/src/plugins/render/opencachingcom/OpenCachingComItem.cpp b/src/plugins/render/opencachingcom/OpenCachingComItem.cpp
index a076924..83d56cb 100644
--- a/src/plugins/render/opencachingcom/OpenCachingComItem.cpp
+++ b/src/plugins/render/opencachingcom/OpenCachingComItem.cpp
@@ -94,7 +94,7 @@ void OpenCachingComItem::showInfoDialog()
// basic details
QString details = "<table><tr><td colspan=\"2\" valign=\"middle\">"
- + tr(m_cache["type"].toString().toUtf8())
+ + tr(m_cache["type"].toString().toUtf8().constData())
+ "<br/>" + id() + "<br/>" + coordinate().toString() + "</td></tr>"
+ "<tr><td align=\"right\">" + tr("Size:") + " </td><td>" + ratingNumberString(m_cache["size"]) + "</td></tr>"
+ "<tr><td align=\"right\">" + tr("Difficulty:") + " </td><td>" + ratingNumberString(m_cache["difficulty"]) + "</td></tr>"
@@ -116,7 +116,7 @@ void OpenCachingComItem::showInfoDialog()
{
strTags += ", ";
}
- strTags += tr(tags[i].toUtf8());
+ strTags += tr(tags[i].toUtf8().constData());
}
m_cache["strTags"] = strTags;
}
@@ -252,7 +252,7 @@ void OpenCachingComItem::updateTooltip()
html += "<tr><td colspan=\"2\"><table cellpadding=\"3\"><tr><td><img src=\":/" + iconName() + "\"></td>"
+ "<td valign=\"middle\"><big><strong>" + m_cache["name"].toString() + "</strong></big></td></tr></table></td></tr>"
+ "<tr><td align=\"left\">"
- + tr(m_cache["type"].toString().toUtf8())
+ + tr(m_cache["type"].toString().toUtf8().constData())
+ "<br/>" + tr( "by <em>" ) + m_cache["hidden_by"].toMap()["name"].toString() + "</em>"
+ "<br/>" + coordinate().lonToString()
+ "<br/>" + coordinate().latToString()
diff --git a/src/plugins/runner/osm/translators/O5mWriter.cpp b/src/plugins/runner/osm/translators/O5mWriter.cpp
index 8cdb999..76084e7 100644
--- a/src/plugins/runner/osm/translators/O5mWriter.cpp
+++ b/src/plugins/runner/osm/translators/O5mWriter.cpp
@@ -85,7 +85,7 @@ void O5mWriter::writeNodes(const OsmConverter::Nodes &nodes, QDataStream &stream
writeTags(osmData, stringTable, bufferStream);
writeUnsigned(buffer.size(), stream);
- stream.writeRawData(buffer.data(), buffer.size());
+ stream.writeRawData(buffer.data().constData(), buffer.size());
lastId = osmData.id();
lastLon = lon;
@@ -127,12 +127,12 @@ void O5mWriter::writeWays(const OsmConverter::Ways &ways, QDataStream &stream) c
QDataStream referencesStream(&referencesBuffer);
writeReferences(*way.first, lastReferenceId, osmData, referencesStream);
writeUnsigned(referencesBuffer.size(), bufferStream);
- bufferStream.writeRawData(referencesBuffer.data(), referencesBuffer.size());
+ bufferStream.writeRawData(referencesBuffer.data().constData(), referencesBuffer.size());
writeTags(osmData, stringTable, bufferStream);
writeUnsigned(buffer.size(), stream);
- stream.writeRawData(buffer.data(), buffer.size());
+ stream.writeRawData(buffer.data().constData(), buffer.size());
}
}
@@ -169,12 +169,12 @@ void O5mWriter::writePolygons(const OsmConverter::Polygons &polygons, QDataStrea
QDataStream referencesStream(&referencesBuffer);
writeRelationMembers(*polygon.first, lastReferenceId, osmData, stringTable, referencesStream);
writeUnsigned(referencesBuffer.size(), bufferStream);
- bufferStream.writeRawData(referencesBuffer.data(), referencesBuffer.size());
+ bufferStream.writeRawData(referencesBuffer.data().constData(), referencesBuffer.size());
writeTags(osmData, stringTable, bufferStream);
writeUnsigned(buffer.size(), stream);
- stream.writeRawData(buffer.data(), buffer.size());
+ stream.writeRawData(buffer.data().constData(), buffer.size());
}
}
@@ -247,7 +247,7 @@ void O5mWriter::writeStringPair(const StringPair &pair, StringTable &stringTable
data.push_back(pair.second.toUtf8());
}
data.push_back(char(0x00));
- stream.writeRawData(data, data.size());
+ stream.writeRawData(data.constData(), data.size());
stringTable.insert(pair, stringTable.size());
} else {
auto const reference = stringTable.size() - iter.value();
diff --git a/tests/AbstractDataPluginTest.cpp b/tests/AbstractDataPluginTest.cpp
index 31b40c8..f1c90e3 100644
--- a/tests/AbstractDataPluginTest.cpp
+++ b/tests/AbstractDataPluginTest.cpp
@@ -42,7 +42,7 @@ void AbstractDataPluginTest::initialize_data()
if ( !dataPlugin )
continue;
- QTest::newRow( plugin->nameId().toLatin1() ) << dataPlugin;
+ QTest::newRow(plugin->nameId().toLatin1().constData()) << dataPlugin;
}
}
diff --git a/tests/AbstractFloatItemTest.cpp b/tests/AbstractFloatItemTest.cpp
index 3831d20..b80d310 100644
--- a/tests/AbstractFloatItemTest.cpp
+++ b/tests/AbstractFloatItemTest.cpp
@@ -100,7 +100,8 @@ void AbstractFloatItemTest::newInstance_data()
QTest::addColumn<const AbstractFloatItem *>( "factory" );
foreach ( const AbstractFloatItem *factory, m_factories ) {
- QTest::newRow( factory->nameId().toLatin1() ) << factory;
+ QTest::newRow(factory->nameId().toLatin1().constData())
+ << factory;
}
}
@@ -121,7 +122,8 @@ void AbstractFloatItemTest::setSettings_data()
QTest::addColumn<const AbstractFloatItem *>( "factory" );
foreach ( const AbstractFloatItem *factory, m_factories ) {
- QTest::newRow( factory->nameId().toLatin1() ) << factory;
+ QTest::newRow(factory->nameId().toLatin1().constData())
+ << factory;
}
}
@@ -156,7 +158,8 @@ void AbstractFloatItemTest::setPosition_data()
QTest::addColumn<const AbstractFloatItem *>( "factory" );
foreach ( const AbstractFloatItem *factory, m_factories ) {
- QTest::newRow( factory->nameId().toLatin1() ) << factory;
+ QTest::newRow(factory->nameId().toLatin1().constData())
+ << factory;
}
}
diff --git a/tests/RenderPluginTest.cpp b/tests/RenderPluginTest.cpp
index cec8c9c..32ed5d3 100644
--- a/tests/RenderPluginTest.cpp
+++ b/tests/RenderPluginTest.cpp
@@ -59,7 +59,8 @@ void RenderPluginTest::newInstance_data()
QTest::addColumn<const RenderPlugin *>( "factory" );
foreach ( const RenderPlugin *factory, m_model.pluginManager()->renderPlugins() ) {
- QTest::newRow( factory->nameId().toLatin1() ) << factory;
+ QTest::newRow(factory->nameId().toLatin1().constData())
+ << factory;
}
}
@@ -85,7 +86,8 @@ void RenderPluginTest::initialize_data()
QTest::addColumn<const RenderPlugin *>( "factory" );
foreach ( const RenderPlugin *plugin, m_model.pluginManager()->renderPlugins() ) {
- QTest::newRow( plugin->nameId().toLatin1() ) << plugin;
+ QTest::newRow(plugin->nameId().toLatin1().constData())
+ << plugin;
}
}
@@ -106,7 +108,8 @@ void RenderPluginTest::setVisible_data()
QTest::addColumn<const RenderPlugin *>( "factory" );
foreach ( const RenderPlugin *factory, m_model.pluginManager()->renderPlugins() ) {
- QTest::newRow( factory->nameId().toLatin1() ) << factory;
+ QTest::newRow(factory->nameId().toLatin1().constData())
+ << factory;
}
}
@@ -140,7 +143,8 @@ void RenderPluginTest::setEnabled_data()
QTest::addColumn<const RenderPlugin *>( "factory" );
foreach ( const RenderPlugin *factory, m_model.pluginManager()->renderPlugins() ) {
- QTest::newRow( factory->nameId().toLatin1() ) << factory;
+ QTest::newRow(factory->nameId().toLatin1().constData())
+ << factory;
}
}
@@ -174,7 +178,8 @@ void RenderPluginTest::setSettingsVisible_data()
QTest::addColumn<const RenderPlugin *>( "factory" );
foreach ( const RenderPlugin *factory, m_model.pluginManager()->renderPlugins() ) {
- QTest::newRow( factory->nameId().toLatin1() ) << factory;
+ QTest::newRow(factory->nameId().toLatin1().constData())
+ << factory;
}
}
@@ -215,7 +220,8 @@ void RenderPluginTest::setSettingsEnabled_data()
QTest::addColumn<const RenderPlugin *>( "factory" );
foreach ( const RenderPlugin *factory, m_model.pluginManager()->renderPlugins() ) {
- QTest::newRow( factory->nameId().toLatin1() ) << factory;
+ QTest::newRow(factory->nameId().toLatin1().constData())
+ << factory;
}
}
@@ -267,7 +273,9 @@ void RenderPluginTest::setSettingsAllEqual_data()
QHash<QString, QVariant>::const_iterator const endpoint = settings.end();
for (; itpoint != endpoint; ++itpoint ) {
const QString testName = QString( "%1 %2" ).arg( plugin->nameId() ).arg( itpoint.key() );
- QTest::newRow( testName.toLatin1() ) << result->settings().value( itpoint.key() ) << expected->settings().value( itpoint.key() );
+ QTest::newRow(testName.toLatin1().constData())
+ << result->settings().value(itpoint.key())
+ << expected->settings().value(itpoint.key());
}
}
}
@@ -298,7 +306,9 @@ void RenderPluginTest::restoreDefaultSettings_data()
QHash<QString, QVariant>::const_iterator const endpoint = settings.end();
for (; itpoint != endpoint; ++itpoint ) {
const QString testName = QString( "%1 %2" ).arg( plugin->nameId() ).arg( itpoint.key() );
- QTest::newRow( testName.toLatin1() ) << result->settings().value( itpoint.key() ) << expected->settings().value( itpoint.key() );
+ QTest::newRow(testName.toLatin1().constData())
+ << result->settings().value(itpoint.key())
+ << expected->settings().value(itpoint.key());
}
}
}
diff --git a/tests/TestGeoDataCoordinates.cpp b/tests/TestGeoDataCoordinates.cpp
index 31c3ee3..bd7c3fd 100644
--- a/tests/TestGeoDataCoordinates.cpp
+++ b/tests/TestGeoDataCoordinates.cpp
@@ -905,7 +905,7 @@ void TestGeoDataCoordinates::testFromStringD_data()
.append(QLatin1Char(latSphere==PosSphere?'P':'N'))
.append(QLatin1Char('|')).append(QLatin1Char(locale==CLocale?'C':'L'))
.append(QLatin1Char('|')).append(string).append(QLatin1Char('|'));
- QTest::newRow(rowTitle.toLatin1())
+ QTest::newRow(rowTitle.toLatin1().constData())
<< string
<< lon
<< lat;
@@ -1480,7 +1480,7 @@ void TestGeoDataCoordinates::testFromLocaleString_data()
QLatin1String("|lat:") +
QString::number(sample.lat, 'f', 10);
- QTest::newRow(rowTitle.toLatin1())
+ QTest::newRow(rowTitle.toLatin1().constData())
<< language.degree
<< language.minutes
<< language.seconds
diff --git a/tests/TestGeoDataWriter.cpp b/tests/TestGeoDataWriter.cpp
index 49fdbb7..0b1765f 100644
--- a/tests/TestGeoDataWriter.cpp
+++ b/tests/TestGeoDataWriter.cpp
@@ -65,7 +65,7 @@ void TestGeoDataWriter::initTestCase()
// Open the files and verify
QVERIFY( file.open( QIODevice::ReadOnly ) );
- QVERIFY2( parser->read( &file ), filename.toLatin1() );
+ QVERIFY2(parser->read(&file), filename.toLatin1().constData());
parsers.insert( filename, parserPointer );
m_testFiles << filename;
diff --git a/tests/TestGeoSceneWriter.cpp b/tests/TestGeoSceneWriter.cpp
index f50b9c8..4649107 100644
--- a/tests/TestGeoSceneWriter.cpp
+++ b/tests/TestGeoSceneWriter.cpp
@@ -92,7 +92,7 @@ void TestGeoSceneWriter::initTestCase()
QVERIFY( file.open( QIODevice::ReadOnly ) );
//Parser and verify
- QVERIFY2( parser->read( &file ), filename.toLatin1() );
+ QVERIFY2(parser->read(&file), filename.toLatin1().constData());
parsers.insert( dataDir.filePath(filename), parserPointer );
@@ -109,7 +109,7 @@ void TestGeoSceneWriter::saveFile_data()
QMap<QString, QSharedPointer<GeoSceneParser> >::iterator itpoint = parsers.begin();
QMap<QString, QSharedPointer<GeoSceneParser> >::iterator const endpoint = parsers.end();
for (; itpoint != endpoint; ++itpoint ) {
- QTest::newRow( itpoint.key().toLocal8Bit() ) << itpoint.value();
+ QTest::newRow(itpoint.key().toLatin1().constData()) << itpoint.value();
}
}
@@ -136,7 +136,7 @@ void TestGeoSceneWriter::saveAndLoad_data()
QMap<QString, QSharedPointer<GeoSceneParser> >::iterator itpoint = parsers.begin();
QMap<QString, QSharedPointer<GeoSceneParser> >::iterator const endpoint = parsers.end();
for (; itpoint != endpoint; ++itpoint ) {
- QTest::newRow( itpoint.key().toLocal8Bit() ) << itpoint.value();
+ QTest::newRow(itpoint.key().toLatin1().constData()) << itpoint.value();
}
}
@@ -168,7 +168,7 @@ void TestGeoSceneWriter::saveAndCompare_data()
QMap<QString, QSharedPointer<GeoSceneParser> >::iterator itpoint = parsers.begin();
QMap<QString, QSharedPointer<GeoSceneParser> >::iterator const endpoint = parsers.end();
for (; itpoint != endpoint; ++itpoint ) {
- QTest::newRow( itpoint.key().toLocal8Bit() ) << itpoint.value() << itpoint.key();
+ QTest::newRow(itpoint.key().toLatin1().constData()) << itpoint.value() << itpoint.key();
}
}