1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-23 21:14:33 +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) {
state = "downloading"; case "forcedDL":
else if (state === "allocating") case "metaDL":
state = "stalledDL"; state = "downloading";
else if (state === "forcedUP") break;
state = "uploading"; case "allocating":
else if (state === "pausedDL") state = "stalledDL";
state = "paused"; break;
else if (state === "pausedUP") case "forcedUP":
state = "completed"; state = "uploading";
else if ((state === "queuedDL") || (state === "queuedUP")) break;
state = "queued"; case "pausedDL":
else if ((state === "checkingDL") || (state === "checkingUP") || state = "paused";
(state === "queuedForChecking") || (state === "checkingResumeData")) break;
state = "checking"; case "pausedUP":
else if ((state === "unknown") || (state === "error") || (state === "missingFiles")) state = "completed";
state = "error"; break;
case "queuedDL":
case "queuedUP":
state = "queued";
break;
case "checkingDL":
case "checkingUP":
case "queuedForChecking":
case "checkingResumeData":
state = "checking";
break;
case "unknown":
case "error":
case "missingFiles":
state = "error";
break;
}
var img_path = 'images/skin/' + state + '.png'; var img_path = 'images/skin/' + state + '.png';