mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-05 11:24:15 +00:00
commit
55b9b8fc91
@ -156,6 +156,8 @@ const int TorrentHandle::MAX_SEEDING_TIME = 525600;
|
|||||||
// The following can be removed after one or two libtorrent releases on each branch.
|
// The following can be removed after one or two libtorrent releases on each branch.
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
const char i18nContext[] = "TorrentHandle";
|
||||||
|
|
||||||
// new constructor is available
|
// new constructor is available
|
||||||
template<typename T, typename std::enable_if<std::is_constructible<T, libt::torrent_info, bool>::value, int>::type = 0>
|
template<typename T, typename std::enable_if<std::is_constructible<T, libt::torrent_info, bool>::value, int>::type = 0>
|
||||||
T makeTorrentCreator(const libtorrent::torrent_info & ti)
|
T makeTorrentCreator(const libtorrent::torrent_info & ti)
|
||||||
@ -1469,7 +1471,7 @@ void TorrentHandle::handleStorageMovedFailedAlert(libtorrent::storage_moved_fail
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger::instance()->addMessage(tr("Could not move torrent: '%1'. Reason: %2")
|
LogMsg(QCoreApplication::translate(i18nContext, "Could not move torrent: '%1'. Reason: %2")
|
||||||
.arg(name()).arg(QString::fromStdString(p->message())), Log::CRITICAL);
|
.arg(name()).arg(QString::fromStdString(p->message())), Log::CRITICAL);
|
||||||
|
|
||||||
m_moveStorageInfo.newPath.clear();
|
m_moveStorageInfo.newPath.clear();
|
||||||
@ -1647,13 +1649,13 @@ void TorrentHandle::handleFastResumeRejectedAlert(libtorrent::fastresume_rejecte
|
|||||||
updateStatus();
|
updateStatus();
|
||||||
if (p->error.value() == libt::errors::mismatching_file_size) {
|
if (p->error.value() == libt::errors::mismatching_file_size) {
|
||||||
// Mismatching file size (files were probably moved)
|
// Mismatching file size (files were probably moved)
|
||||||
logger->addMessage(tr("File sizes mismatch for torrent '%1', pausing it.").arg(name()), Log::CRITICAL);
|
logger->addMessage(QCoreApplication::translate(i18nContext, "File sizes mismatch for torrent '%1', pausing it.").arg(name()), Log::CRITICAL);
|
||||||
m_hasMissingFiles = true;
|
m_hasMissingFiles = true;
|
||||||
if (!isPaused())
|
if (!isPaused())
|
||||||
pause();
|
pause();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger->addMessage(tr("Fast resume data was rejected for torrent '%1'. Reason: %2. Checking again...")
|
logger->addMessage(QCoreApplication::translate(i18nContext, "Fast resume data was rejected for torrent '%1'. Reason: %2. Checking again...")
|
||||||
.arg(name()).arg(QString::fromStdString(p->message())), Log::CRITICAL);
|
.arg(name()).arg(QString::fromStdString(p->message())), Log::CRITICAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,14 +28,20 @@
|
|||||||
* Contact : chris@qbittorrent.org
|
* Contact : chris@qbittorrent.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <QStyleOptionViewItem>
|
#include <QCoreApplication>
|
||||||
#include <QModelIndex>
|
#include <QModelIndex>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QProgressBar>
|
#include <QProgressBar>
|
||||||
|
#include <QStyleOptionViewItem>
|
||||||
|
|
||||||
#include "base/utils/misc.h"
|
#include "base/utils/misc.h"
|
||||||
#include "searchsortmodel.h"
|
|
||||||
#include "searchlistdelegate.h"
|
#include "searchlistdelegate.h"
|
||||||
|
#include "searchsortmodel.h"
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
const char i18nContext[] = "SearchListDelegate";
|
||||||
|
}
|
||||||
|
|
||||||
SearchListDelegate::SearchListDelegate(QObject *parent)
|
SearchListDelegate::SearchListDelegate(QObject *parent)
|
||||||
: QItemDelegate(parent)
|
: QItemDelegate(parent)
|
||||||
@ -57,7 +63,8 @@ void SearchListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
|
|||||||
case SearchSortModel::SEEDS:
|
case SearchSortModel::SEEDS:
|
||||||
case SearchSortModel::LEECHES:
|
case SearchSortModel::LEECHES:
|
||||||
opt.displayAlignment = Qt::AlignRight | Qt::AlignVCenter;
|
opt.displayAlignment = Qt::AlignRight | Qt::AlignVCenter;
|
||||||
QItemDelegate::drawDisplay(painter, opt, option.rect, (index.data().toLongLong() >= 0) ? index.data().toString() : tr("Unknown"));
|
QItemDelegate::drawDisplay(painter, opt, option.rect
|
||||||
|
, (index.data().toLongLong() >= 0) ? index.data().toString() : QCoreApplication::translate(i18nContext, "Unknown"));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
QItemDelegate::paint(painter, option, index);
|
QItemDelegate::paint(painter, option, index);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user