summaryrefslogtreecommitdiffstats
path: root/examples/network
diff options
context:
space:
mode:
Diffstat (limited to 'examples/network')
-rw-r--r--examples/network/torrent/bencodeparser.cpp4
-rw-r--r--examples/network/torrent/metainfo.cpp4
-rw-r--r--examples/network/torrent/trackerclient.cpp2
3 files changed, 5 insertions, 5 deletions
diff --git a/examples/network/torrent/bencodeparser.cpp b/examples/network/torrent/bencodeparser.cpp
index d6b6078..aa498d6 100644
--- a/examples/network/torrent/bencodeparser.cpp
+++ b/examples/network/torrent/bencodeparser.cpp
@@ -171,7 +171,7 @@ bool BencodeParser::getList(QList<QVariant> *list)
else if (getList(&tmpList))
tmp << tmpList;
else if (getDictionary(&dictionary))
- tmp << qVariantFromValue<QMap<QByteArray, QVariant> >(dictionary);
+ tmp << QVariant::fromValue<QMap<QByteArray, QVariant> >(dictionary);
else {
errString = QString("error at index %1").arg(index);
return false;
@@ -217,7 +217,7 @@ bool BencodeParser::getDictionary(QMap<QByteArray, QVariant> *dictionary)
else if (getList(&tmpList))
tmp.insert(key, tmpList);
else if (getDictionary(&dictionary))
- tmp.insert(key, qVariantFromValue<QMap<QByteArray, QVariant> >(dictionary));
+ tmp.insert(key, QVariant::fromValue<QMap<QByteArray, QVariant> >(dictionary));
else {
errString = QString("error at index %1").arg(index);
return false;
diff --git a/examples/network/torrent/metainfo.cpp b/examples/network/torrent/metainfo.cpp
index a6e7511..a7cd978 100644
--- a/examples/network/torrent/metainfo.cpp
+++ b/examples/network/torrent/metainfo.cpp
@@ -83,7 +83,7 @@ bool MetaInfo::parse(const QByteArray &data)
if (!dict.contains("info"))
return false;
- QMap<QByteArray, QVariant> info = qVariantValue<Dictionary>(dict.value("info"));
+ QMap<QByteArray, QVariant> info = qvariant_cast<Dictionary>(dict.value("info"));
if (info.contains("files")) {
metaInfoFileForm = MultiFileForm;
@@ -91,7 +91,7 @@ bool MetaInfo::parse(const QByteArray &data)
QList<QVariant> files = info.value("files").toList();
for (int i = 0; i < files.size(); ++i) {
- QMap<QByteArray, QVariant> file = qVariantValue<Dictionary>(files.at(i));
+ QMap<QByteArray, QVariant> file = qvariant_cast<Dictionary>(files.at(i));
QList<QVariant> pathElements = file.value("path").toList();
QByteArray path;
foreach (QVariant p, pathElements) {
diff --git a/examples/network/torrent/trackerclient.cpp b/examples/network/torrent/trackerclient.cpp
index 61d7e95..07194fa 100644
--- a/examples/network/torrent/trackerclient.cpp
+++ b/examples/network/torrent/trackerclient.cpp
@@ -210,7 +210,7 @@ void TrackerClient::httpRequestDone(bool error)
QList<QVariant> peerTmp = peerEntry.toList();
for (int i = 0; i < peerTmp.size(); ++i) {
TorrentPeer tmp;
- QMap<QByteArray, QVariant> peer = qVariantValue<QMap<QByteArray, QVariant> >(peerTmp.at(i));
+ QMap<QByteArray, QVariant> peer = qvariant_cast<QMap<QByteArray, QVariant> >(peerTmp.at(i));
tmp.id = QString::fromUtf8(peer.value("peer id").toByteArray());
tmp.address.setAddress(QString::fromUtf8(peer.value("ip").toByteArray()));
tmp.port = peer.value("port").toInt();