diff options
| author | Skye Deving <76892045+skyedeving@users.noreply.github.com> | 2021-01-04 19:49:40 -0600 |
|---|---|---|
| committer | Skye Deving <76892045+skyedeving@users.noreply.github.com> | 2021-01-04 19:58:30 -0600 |
| commit | 5abc685b47c7ebd9e8713c087f8c4f00d9c27396 (patch) | |
| tree | 56287dde3681a86103709239f71a76207dec4cd7 | |
| parent | 4d02cc8d680f4e069de0dddc8558ff9186153d59 (diff) | |
Sort case evidence numerically before adding in
inventories get displayed lexigraphically too but it is assumed to not
matter
| -rw-r--r-- | include/courtroom.h | 1 | ||||
| -rw-r--r-- | src/courtroom.cpp | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/include/courtroom.h b/include/courtroom.h index f05b15ac..4e8d86f7 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -58,6 +58,7 @@ #include <QTextCharFormat> //#include <QRandomGenerator> +#include <algorithm> #include <stack> class AOApplication; diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 95189112..bcff915d 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -3588,7 +3588,15 @@ void Courtroom::on_ooc_return_pressed() new AOPacket("DE#" + QString::number(i) + "#%")); } - foreach (QString evi, casefile.childGroups()) { + // sort the case_evidence numerically + QStringList case_evidence = casefile.childGroups(); + std::sort(case_evidence.begin(), case_evidence.end(), + [] (const QString &a, const QString &b) { + return a.toInt() < b.toInt(); + }); + + // load evidence + foreach (QString evi, case_evidence) { if (evi == "General") continue; |
