From fe3a514aaf4e01a5d336f0c0f18ec0517a154cdf Mon Sep 17 00:00:00 2001 From: Bionus Date: Sun, 24 Nov 2024 16:21:02 +0100 Subject: [PATCH] feat: add "suffix without extension" log file path type (fix #3325) --- src/gui/src/settings/log-window.cpp | 2 ++ src/gui/src/settings/log-window.ui | 49 +++++++++++++++++++++++++++-- src/lib/src/models/image.cpp | 2 ++ 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/src/gui/src/settings/log-window.cpp b/src/gui/src/settings/log-window.cpp index 85f04856e..08bbcdedf 100644 --- a/src/gui/src/settings/log-window.cpp +++ b/src/gui/src/settings/log-window.cpp @@ -22,6 +22,7 @@ LogWindow::LogWindow(int index, Profile *profile, QWidget *parent) ui->lineFilename->setText(dta["filename"].toString()); ui->lineUniquePath->setText(dta["uniquePath"].toString()); ui->lineSuffix->setText(dta["suffix"].toString()); + ui->lineSuffixWithoutExtension->setText(dta["suffixWithoutExtension"].toString()); ui->textEditContent->setPlainText(dta["content"].toString()); } @@ -69,6 +70,7 @@ void LogWindow::save() dta["filename"] = ui->lineFilename->text(); dta["uniquePath"] = ui->lineUniquePath->text(); dta["suffix"] = ui->lineSuffix->text(); + dta["suffixWithoutExtension"] = ui->lineSuffixWithoutExtension->text(); dta["content"] = ui->textEditContent->toPlainText(); emit validated(m_index, dta); diff --git a/src/gui/src/settings/log-window.ui b/src/gui/src/settings/log-window.ui index d9fefa7cf..fabd52eff 100644 --- a/src/gui/src/settings/log-window.ui +++ b/src/gui/src/settings/log-window.ui @@ -38,6 +38,11 @@ Suffix + + + Suffix without extension + + @@ -174,7 +179,45 @@ - + + + + true + + + + Each time an image is saved, an external text file will be saved with the same name at the same location. + + + true + + + + + + + + + 0 + + + 0 + + + 0 + + + + + Suffix + + + + + + + + true @@ -205,10 +248,10 @@ - Qt::Horizontal + Qt::Orientation::Horizontal - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok diff --git a/src/lib/src/models/image.cpp b/src/lib/src/models/image.cpp index 23c9f13b1..b3eaa0a07 100644 --- a/src/lib/src/models/image.cpp +++ b/src/lib/src/models/image.cpp @@ -766,6 +766,8 @@ QString Image::postSaving(const QString &originalPath, Size size, bool addMd5, b fileTagsPath = logFile["uniquePath"].toString(); } else if (locationType == 2) { fileTagsPath = path + logFile["suffix"].toString(); + } else if (locationType == 3) { + fileTagsPath = setExtension(path, "") + logFile["suffixWithoutExtension"].toString(); } // Replace some post-save tokens