From 963d73af4e107b45cd25b404082ace00195e6da9 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Fri, 21 May 2010 11:25:30 +0000 Subject: [PATCH] ETA for finished torrent is now 0 instead of Infinite (closes #583704) Fix unicode issue in start seeding after torrent creation code --- src/createtorrent_imp.cpp | 2 +- src/misc.cpp | 3 +++ src/transferlistwidget.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/createtorrent_imp.cpp b/src/createtorrent_imp.cpp index 67bc8a57a..4dbd38b59 100644 --- a/src/createtorrent_imp.cpp +++ b/src/createtorrent_imp.cpp @@ -199,7 +199,7 @@ void createtorrent::handleCreationSuccess(QString path, const char* branch_path) return; } QString hash = misc::toQString(t->info_hash()); - TorrentTempData::setSavePath(hash, QString(branch_path)); + TorrentTempData::setSavePath(hash, QString::fromLocal8Bit(branch_path)); #ifdef LIBTORRENT_0_15 // Enable seeding mode (do not recheck the files) TorrentTempData::setSeedingMode(hash, true); diff --git a/src/misc.cpp b/src/misc.cpp index ee75f8135..a0992c139 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -522,6 +522,9 @@ QString misc::userFriendlyDuration(qlonglong seconds) { if(seconds < 0) { return QString::fromUtf8("∞"); } + if(seconds == 0) { + return "0"; + } if(seconds < 60) { return tr("< 1m", "< 1 minute"); } diff --git a/src/transferlistwidget.cpp b/src/transferlistwidget.cpp index 8d0da7092..008510633 100644 --- a/src/transferlistwidget.cpp +++ b/src/transferlistwidget.cpp @@ -454,7 +454,7 @@ void TransferListWidget::setFinished(QTorrentHandle &h) { listModel->setData(listModel->index(row, TR_STATUS), STATE_STALLED_UP); setRowColor(row, QApplication::palette().color(QPalette::WindowText)); } - listModel->setData(listModel->index(row, TR_ETA), QVariant((qlonglong)-1)); + listModel->setData(listModel->index(row, TR_ETA), QVariant((qlonglong)0)); listModel->setData(listModel->index(row, TR_DLSPEED), QVariant((double)0.)); listModel->setData(listModel->index(row, TR_PROGRESS), QVariant((double)1.)); listModel->setData(listModel->index(row, TR_PRIORITY), QVariant((int)-1));