diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-01-23 11:29:55 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-02-12 19:40:09 +0000 |
commit | f2e3fdc803b9842b6ba4aefe7becdd42eafc4d38 (patch) | |
tree | 02d3c5e43602c6c3c729614fe3655ec9a8b5b8c1 /examples/network/torrent/connectionmanager.cpp | |
parent | 05c38a9111320da311e5993faf12ce8e1f1713e8 (diff) |
examples: migrate to QString::asprintf
Not that many, if any, uses of sprintf here were idiomatic Qt,
but that's for another commit.
Change-Id: Ic34470d9799942f786770ba9541b29c34d67c6f8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'examples/network/torrent/connectionmanager.cpp')
-rw-r--r-- | examples/network/torrent/connectionmanager.cpp | 4 |
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(), '-'); } |