From da5437ab6fcb06cc238f7336b5b88b15fc228e0b Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 29 Jul 2022 18:39:10 +0300 Subject: [PATCH] Fix evidence image lookup behaving weirdly if the mounted path from which it looks for evidence starts with "base" , so "base_Extra" will be ignored for example if it's next to the normal "base" folder (#825) Start evidence image search in the base evidence folder rather than the topmost mounted path --- src/evidence.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/evidence.cpp b/src/evidence.cpp index 34f09a6..13634ec 100644 --- a/src/evidence.cpp +++ b/src/evidence.cpp @@ -398,7 +398,7 @@ void Courtroom::on_evidence_image_name_edited() void Courtroom::on_evidence_image_button_clicked() { - QDir dir(ao_app->get_real_path(ao_app->get_evidence_path(""))); + QDir dir("base/evidence/"); QFileDialog dialog(this); dialog.setFileMode(QFileDialog::ExistingFile); dialog.setNameFilter(tr("Images (*.png)")); @@ -418,7 +418,7 @@ void Courtroom::on_evidence_image_button_clicked() bases.prepend(ao_app->get_base_path()); for (const QString &base : bases) { QDir baseDir(base); - if (filename.startsWith(baseDir.absolutePath())) { + if (filename.startsWith(baseDir.absolutePath() + "/")) { dir.setPath(baseDir.absolutePath() + "/evidence"); break; }