Don't use Preferences in BitTorrent::Session

This commit is contained in:
Vladimir Golovnev (Glassez) 2016-05-01 11:05:52 +03:00
parent ce22d031f6
commit b2cb473b63
24 changed files with 2155 additions and 1840 deletions

View file

@ -437,7 +437,9 @@ void TransferListWidget::setDlLimitSelectedTorrents()
int default_limit = -1;
if (all_same_limit)
default_limit = selected_torrents.first()->downloadLimit();
const long new_limit = SpeedLimitDialog::askSpeedLimit(&ok, tr("Torrent Download Speed Limiting"), default_limit, Preferences::instance()->getGlobalDownloadLimit() * 1024.);
const long new_limit = SpeedLimitDialog::askSpeedLimit(
&ok, tr("Torrent Download Speed Limiting"), default_limit
, BitTorrent::Session::instance()->globalDownloadSpeedLimit());
if (ok) {
foreach (BitTorrent::TorrentHandle *const torrent, selected_torrents) {
qDebug("Applying download speed limit of %ld Kb/s to torrent %s", (long)(new_limit / 1024.), qPrintable(torrent->hash()));
@ -466,7 +468,9 @@ void TransferListWidget::setUpLimitSelectedTorrents()
int default_limit = -1;
if (all_same_limit)
default_limit = selected_torrents.first()->uploadLimit();
const long new_limit = SpeedLimitDialog::askSpeedLimit(&ok, tr("Torrent Upload Speed Limiting"), default_limit, Preferences::instance()->getGlobalUploadLimit() * 1024.);
const long new_limit = SpeedLimitDialog::askSpeedLimit(
&ok, tr("Torrent Upload Speed Limiting"), default_limit
, BitTorrent::Session::instance()->globalUploadSpeedLimit());
if (ok) {
foreach (BitTorrent::TorrentHandle *const torrent, selected_torrents) {
qDebug("Applying upload speed limit of %ld Kb/s to torrent %s", (long)(new_limit / 1024.), qPrintable(torrent->hash()));
@ -512,7 +516,7 @@ void TransferListWidget::displayDLHoSMenu(const QPoint&)
hideshowColumn.setTitle(tr("Column visibility"));
QList<QAction*> actions;
for (int i = 0; i < listModel->columnCount(); ++i) {
if (!BitTorrent::Session::instance()->isQueueingEnabled() && i == TorrentModel::TR_PRIORITY) {
if (!BitTorrent::Session::instance()->isQueueingSystemEnabled() && i == TorrentModel::TR_PRIORITY) {
actions.append(0);
continue;
}
@ -827,7 +831,7 @@ void TransferListWidget::displayListMenu(const QPoint&)
listMenu.addSeparator();
}
listMenu.addAction(&actionOpen_destination_folder);
if (BitTorrent::Session::instance()->isQueueingEnabled() && one_not_seed) {
if (BitTorrent::Session::instance()->isQueueingSystemEnabled() && one_not_seed) {
listMenu.addSeparator();
QMenu *prioMenu = listMenu.addMenu(tr("Priority"));
prioMenu->addAction(&actionTopPriority);