From d5d173bb84ae1e1e6cf2b7da6b510ce76ff84020 Mon Sep 17 00:00:00 2001 From: Gavin MacGregor Date: Sun, 12 Jan 2025 14:54:08 +0000 Subject: [PATCH] Fix filename suggestion of exported image If the filename had a non-TTI extension it would not have been changed to PNG or GIF. --- src/qteletextmaker/mainwindow.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/qteletextmaker/mainwindow.cpp b/src/qteletextmaker/mainwindow.cpp index df36dcd..f20189e 100644 --- a/src/qteletextmaker/mainwindow.cpp +++ b/src/qteletextmaker/mainwindow.cpp @@ -190,11 +190,8 @@ void MainWindow::exportImage() else { // Image not exported before: suggest a filename with image extension // If page has flashing, suggest GIF - exportFileName = m_curFile; - if (m_textWidget->flashTiming() != 0) - changeSuffixFromTTI(exportFileName, "gif"); - else - changeSuffixFromTTI(exportFileName, "png"); + exportFileName = m_curFile.left(m_curFile.lastIndexOf('.')); + exportFileName.append(m_textWidget->flashTiming() != 0 ? ".gif" : ".png"); } if (m_textWidget->flashTiming() != 0)