From 5a475211f5f2c5fd4ab88cbe10492ff198b2a474 Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 7 Sep 2018 13:41:43 +0100 Subject: [PATCH] Don't use QFileInfo to get directory part of remote path. Refs #1094 * QFileInfo implicitly converts the path to the local OS's representation, and we want to preserve the native path format. --- qrenderdoc/Windows/Dialogs/CaptureDialog.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp b/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp index 2add1b8ee..6071f59e0 100644 --- a/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp @@ -931,9 +931,17 @@ void CaptureDialog::SetExecutableFilename(const rdcstr &filename) ui->exePath->setText(fn); if(m_Ctx.Replay().CurrentRemote()) - m_Ctx.Replay().CurrentRemote()->lastCapturePath = QFileInfo(fn).absolutePath(); + { + // remove the filename itself + int idx = fn.lastIndexOf(QLatin1Char('/')); + if(idx >= 0) + fn = fn.mid(0, idx); + m_Ctx.Replay().CurrentRemote()->lastCapturePath = fn; + } else + { m_Ctx.Config().LastCapturePath = QFileInfo(fn).absolutePath(); + } m_Ctx.Config().Save(); }