browser: make sorting optional

This adds a new option, "noop", to browser_sort_mode. If this mode
is selected, no sorting is done in the browser view, and the elements
are shown in the same order as received from the MPD server.
This commit is contained in:
Trygve Aaberge
2014-08-29 17:10:40 +02:00
committed by Andrzej Rybczak
parent 49f53c07bb
commit 9e8dc741e5
7 changed files with 29 additions and 13 deletions

View File

@@ -60,6 +60,9 @@ std::ostream &operator<<(std::ostream &os, SortMode sm)
case SortMode::CustomFormat:
os << "format";
break;
case SortMode::NoOp:
os << "noop";
break;
}
return os;
}
@@ -74,6 +77,8 @@ std::istream &operator>>(std::istream &is, SortMode &sm)
sm = SortMode::ModificationTime;
else if (ssm == "format")
sm = SortMode::CustomFormat;
else if (ssm == "noop")
sm = SortMode::NoOp;
else
is.setstate(std::ios::failbit);
return is;