From 62b9245215b509eb753406b1983bdbd2baba0eb8 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 18 Sep 2019 11:18:28 +0100 Subject: [PATCH] Calculate basename by hand, for windows paths on linux --- qrenderdoc/Windows/Dialogs/CaptureDialog.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp b/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp index 6ab92ee58..16e620873 100644 --- a/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp @@ -119,9 +119,19 @@ void CaptureDialog::PopulateMostRecent() fullName |= (exe.indexOf(QLatin1Char('\\')) < 0 && exe.count(QLatin1Char('/')) == 1); if(fullName) + { ui->loadLastCapture->setText(tr("Load Last Settings - %1").arg(exe)); + } else - ui->loadLastCapture->setText(tr("Load Last Settings - %1").arg(QFileInfo(exe).fileName())); + { + int offs = exe.lastIndexOf(QLatin1Char('\\')); + if(offs > 0) + exe.remove(0, offs + 1); + offs = exe.lastIndexOf(QLatin1Char('/')); + if(offs > 0) + exe.remove(0, offs + 1); + ui->loadLastCapture->setText(tr("Load Last Settings - %1").arg(exe)); + } return; } }