diff options
| author | oldmud0 <oldmud0@users.noreply.github.com> | 2021-01-04 23:52:25 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-04 23:52:25 -0600 |
| commit | f77ae093e3d5fd86e029cb6309fa3ca34b84fddb (patch) | |
| tree | 56287dde3681a86103709239f71a76207dec4cd7 | |
| parent | 4d02cc8d680f4e069de0dddc8558ff9186153d59 (diff) | |
| parent | 5abc685b47c7ebd9e8713c087f8c4f00d9c27396 (diff) | |
Merge pull request #370 from skyedeving/fix-evidence-loading
Sort case evidence numerically before adding in
| -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; |
