From 302671878822ee74e0eaf13030a75b33bfd4765c Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 27 Aug 2026 12:44:00 +0100 Subject: [PATCH] Handle an empty title as "Untitled script" in python editor wrapper --- qrenderdoc/Windows/PythonShell.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qrenderdoc/Windows/PythonShell.cpp b/qrenderdoc/Windows/PythonShell.cpp index 07b65eae8..7af65c10f 100644 --- a/qrenderdoc/Windows/PythonShell.cpp +++ b/qrenderdoc/Windows/PythonShell.cpp @@ -77,7 +77,7 @@ EditorWrapper::EditorWrapper(PythonShell *parent) : QFrame(parent), m_PyShell(pa layout()->setMargin(0); layout()->setContentsMargins(0, 0, 0, 0); - m_Title = tr("Untitled Script"); + setTitle(QString()); } EditorWrapper::~EditorWrapper() @@ -97,7 +97,10 @@ void EditorWrapper::setTitle(QString title) { if(!m_Filename.isEmpty()) return; - m_Title = title; + if(title.isEmpty()) + m_Title = tr("Untitled Script"); + else + m_Title = title; updateTitle(); } @@ -155,7 +158,7 @@ bool EditorWrapper::checkAllowClose() if(filename.isEmpty()) { untitled = true; - filename = lit("Untitled Script"); + filename = m_Title; } QMessageBox::StandardButton res = RDDialog::question(this, tr("Python script is modified"), tr("You have unsaved changes to '%1'.\n"