From e647b3e67a4b23d383dd0551e7102ab1300419be Mon Sep 17 00:00:00 2001 From: Gavin MacGregor Date: Tue, 25 Mar 2025 18:58:23 +0000 Subject: [PATCH] Decide to activate export option from loading class --- src/qteletextmaker/mainwindow.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/qteletextmaker/mainwindow.cpp b/src/qteletextmaker/mainwindow.cpp index c630e0a..9036047 100644 --- a/src/qteletextmaker/mainwindow.cpp +++ b/src/qteletextmaker/mainwindow.cpp @@ -1050,7 +1050,6 @@ void MainWindow::loadFile(const QString &fileName) int levelSeen; QFile file(fileName); - const QFileInfo fileInfo(file); LoadFormat *loadingFormat = m_loadFormats.findFormat(QFileInfo(fileName).suffix()); if (loadingFormat == nullptr) { @@ -1070,11 +1069,10 @@ void MainWindow::loadFile(const QString &fileName) QApplication::setOverrideCursor(Qt::WaitCursor); if (loadingFormat->load(&file, m_textWidget->document())) { - // TODO put "native format" into class? - if (fileInfo.suffix() == "tti" || fileInfo.suffix() == "ttix") - m_exportAutoFileName.clear(); - else + if (m_saveFormats.isExportOnly(QFileInfo(file).suffix())) m_exportAutoFileName = fileName; + else + m_exportAutoFileName.clear(); } else { QApplication::restoreOverrideCursor(); QMessageBox::warning(this, QApplication::applicationDisplayName(), tr("Cannot load file %1\n%2").arg(QDir::toNativeSeparators(fileName), loadingFormat->errorString()));