From ca8a257a9b9b846e8f7a9143082d97abdb2d450f Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 16 Oct 2022 13:55:31 -0700 Subject: [PATCH] footagerelinkdialog: disable filename filter because it breaks on Windows --- app/dialog/footagerelink/footagerelinkdialog.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/dialog/footagerelink/footagerelinkdialog.cpp b/app/dialog/footagerelink/footagerelinkdialog.cpp index 2f89de75e..066c163e6 100644 --- a/app/dialog/footagerelink/footagerelinkdialog.cpp +++ b/app/dialog/footagerelink/footagerelinkdialog.cpp @@ -102,8 +102,16 @@ void FootageRelinkDialog::BrowseForFootage() QString new_fn = QFileDialog::getOpenFileName(this, tr("Relink \"%1\"").arg(f->GetLabel()), - info.absolutePath(), - QStringLiteral("%1;;%2 (**)").arg(info.fileName(), tr("All Files"))); + info.absolutePath()); + + // Originally, this function would attempt to filter to the exact filename of the missing file. + // However, this would break on Windows if the filename had any spaces in it. The reason is + // Windows separates its extensions with ';' while Qt separates them with ' '. Qt isn't + // intelligent enough to determine whether it's a list of extensions or a single filename with a + // space in it, it just does a global replace of ' ' to ';'. There's no way around it, outside of + // bypassing Qt entirely and using Win32's GetOpenFileName() directly. As annoying as it is, I've + // just disabled it for now. + //QStringLiteral("%1 (\"%1\");;%2 (*)").arg(info.fileName(), tr("All Files"))); // We received a new filename if (!new_fn.isEmpty()) {