diff options
Diffstat (limited to 'examples/network/torrent/addtorrentdialog.cpp')
-rw-r--r-- | examples/network/torrent/addtorrentdialog.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/examples/network/torrent/addtorrentdialog.cpp b/examples/network/torrent/addtorrentdialog.cpp index 4c63d3293e..a0d21598c3 100644 --- a/examples/network/torrent/addtorrentdialog.cpp +++ b/examples/network/torrent/addtorrentdialog.cpp @@ -48,16 +48,14 @@ static QString stringNumber(qint64 number) { - QString tmp; if (number > (1024 * 1024 * 1024)) - tmp.sprintf("%.2fGB", number / (1024.0 * 1024.0 * 1024.0)); + return QString::asprintf("%.2fGB", number / (1024.0 * 1024.0 * 1024.0)); else if (number > (1024 * 1024)) - tmp.sprintf("%.2fMB", number / (1024.0 * 1024.0)); + return QString::asprintf("%.2fMB", number / (1024.0 * 1024.0)); else if (number > (1024)) - tmp.sprintf("%.2fKB", number / (1024.0)); + return QString::asprintf("%.2fKB", number / (1024.0)); else - tmp.sprintf("%d bytes", int(number)); - return tmp; + return QString::asprintf("%d bytes", int(number)); } AddTorrentDialog::AddTorrentDialog(QWidget *parent) |