Browse Source

Merge pull request #3209 from ngosang/minor_fixes

Code clean up
adaptive-webui-19844
sledgehammer999 10 years ago
parent
commit
9ee67364c2
  1. 11
      src/gui/addnewtorrentdialog.cpp
  2. 8
      src/webui/webapplication.cpp

11
src/gui/addnewtorrentdialog.cpp

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

8
src/webui/webapplication.cpp

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

Loading…
Cancel
Save