Browse Source

Code clean up

This changes were proposed by @PiotrNawrot in these PRs: #2967, #2970.
adaptive-webui-19844
ngosang 10 years ago
parent
commit
4a76526417
  1. 15
      src/gui/addnewtorrentdialog.cpp
  2. 16
      src/webui/webapplication.cpp

15
src/gui/addnewtorrentdialog.cpp

@ -555,16 +555,13 @@ void AddNewTorrentDialog::displayContentTreeMenu(const QPoint&) @@ -555,16 +555,13 @@ void AddNewTorrentDialog::displayContentTreeMenu(const QPoint&)
}
else {
int prio = prio::NORMAL;
if (act == ui->actionHigh) {
if (act == ui->actionHigh)
prio = prio::HIGH;
}
else {
if (act == ui->actionMaximum)
prio = prio::MAXIMUM;
else
if (act == ui->actionNot_downloaded)
prio = prio::IGNORED;
}
else if (act == ui->actionMaximum)
prio = prio::MAXIMUM;
else if (act == ui->actionNot_downloaded)
prio = prio::IGNORED;
qDebug("Setting files priority");
foreach (const QModelIndex &index, selectedRows) {
qDebug("Setting priority(%d) for file at row %d", prio, index.row());

16
src/webui/webapplication.cpp

@ -688,18 +688,14 @@ void WebApplication::parsePath() @@ -688,18 +688,14 @@ void WebApplication::parsePath()
// check action for requested path
QStringList pathItems = request().path.split('/', QString::SkipEmptyParts);
if (!pathItems.empty()) {
if (actions_.contains(pathItems.front())) {
scope_ = pathItems.front();
pathItems.pop_front();
}
if (!pathItems.empty() && actions_.contains(pathItems.front())) {
scope_ = pathItems.front();
pathItems.pop_front();
}
if (!pathItems.empty()) {
if (actions_[scope_].contains(pathItems.front())) {
action_ = pathItems.front();
pathItems.pop_front();
}
if (!pathItems.empty() && actions_[scope_].contains(pathItems.front())) {
action_ = pathItems.front();
pathItems.pop_front();
}
args_ = pathItems;

Loading…
Cancel
Save