summaryrefslogtreecommitdiffstats
path: root/examples/network/torrent/connectionmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/network/torrent/connectionmanager.cpp')
-rw-r--r--examples/network/torrent/connectionmanager.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/network/torrent/connectionmanager.cpp b/examples/network/torrent/connectionmanager.cpp
index b21ed79394..134eb7eca2 100644
--- a/examples/network/torrent/connectionmanager.cpp
+++ b/examples/network/torrent/connectionmanager.cpp
@@ -78,9 +78,7 @@ QByteArray ConnectionManager::clientId() const
// Generate peer id
int startupTime = int(QDateTime::currentDateTime().toTime_t());
- QString s;
- s.sprintf("-QT%04x-", (QT_VERSION % 0xffff00) >> 8);
- id += s.toLatin1();
+ id += QString::asprintf("-QT%04x-", (QT_VERSION % 0xffff00) >> 8).toLatin1();
id += QByteArray::number(startupTime, 10);
id += QByteArray(20 - id.size(), '-');
}