1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-02-03 02:14:16 +00:00

Use switch statement

This commit is contained in:
Thomas Piccirello 2018-01-15 21:20:38 -05:00
parent 8e9b928b61
commit 6d0cceca83

View File

@ -777,23 +777,39 @@ var TorrentsTable = new Class({
this.columns['state_icon'].updateTd = function (td, row) { this.columns['state_icon'].updateTd = function (td, row) {
var state = this.getRowValue(row); var state = this.getRowValue(row);
if ((state === "forcedDL") || (state === "metaDL")) switch (state) {
case "forcedDL":
case "metaDL":
state = "downloading"; state = "downloading";
else if (state === "allocating") break;
case "allocating":
state = "stalledDL"; state = "stalledDL";
else if (state === "forcedUP") break;
case "forcedUP":
state = "uploading"; state = "uploading";
else if (state === "pausedDL") break;
case "pausedDL":
state = "paused"; state = "paused";
else if (state === "pausedUP") break;
case "pausedUP":
state = "completed"; state = "completed";
else if ((state === "queuedDL") || (state === "queuedUP")) break;
case "queuedDL":
case "queuedUP":
state = "queued"; state = "queued";
else if ((state === "checkingDL") || (state === "checkingUP") || break;
(state === "queuedForChecking") || (state === "checkingResumeData")) case "checkingDL":
case "checkingUP":
case "queuedForChecking":
case "checkingResumeData":
state = "checking"; state = "checking";
else if ((state === "unknown") || (state === "error") || (state === "missingFiles")) break;
case "unknown":
case "error":
case "missingFiles":
state = "error"; state = "error";
break;
}
var img_path = 'images/skin/' + state + '.png'; var img_path = 'images/skin/' + state + '.png';