diff --git a/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp b/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp index 6071f59e0..2b6aec8e6 100644 --- a/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp @@ -932,10 +932,23 @@ void CaptureDialog::SetExecutableFilename(const rdcstr &filename) if(m_Ctx.Replay().CurrentRemote()) { - // remove the filename itself + // remove the filename itself before setting the last capture path. Try /, then \ as path + // separator. If no separators are found, there is no path to set. int idx = fn.lastIndexOf(QLatin1Char('/')); if(idx >= 0) + { fn = fn.mid(0, idx); + } + else + { + idx = fn.lastIndexOf(QLatin1Char('\\')); + + if(idx >= 0) + fn = fn.mid(0, idx); + else + fn = QString(); + } + m_Ctx.Replay().CurrentRemote()->lastCapturePath = fn; } else