diff --git a/src/gui/addnewtorrentdialog.cpp b/src/gui/addnewtorrentdialog.cpp index 1afafa26a..f99cfa196 100644 --- a/src/gui/addnewtorrentdialog.cpp +++ b/src/gui/addnewtorrentdialog.cpp @@ -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()); diff --git a/src/webui/webapplication.cpp b/src/webui/webapplication.cpp index aae42a6d0..cf02e52a1 100644 --- a/src/webui/webapplication.cpp +++ b/src/webui/webapplication.cpp @@ -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;