diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index 9792522c7..8d1d19935 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -345,7 +345,7 @@ bool BatchQueue::loadBatchQueue () auto prevw = prevh; thumb->getThumbnailSize (prevw, prevh, &pparams); - auto entry = new BatchQueueEntry (job, pparams, source, prevw, prevh, thumb); + auto entry = new BatchQueueEntry (job, pparams, source, prevw, prevh, thumb, options.overwriteOutputFile); thumb->decreaseRef (); // Removing the refCount acquired by cacheMgr->getEntry entry->setParent (this); @@ -942,7 +942,7 @@ Glib::ustring BatchQueue::autoCompleteFileName (const Glib::ustring& fileName, c // In overwrite mode we TRY to delete the old file first. // if that's not possible (e.g. locked by viewer, R/O), we revert to the standard naming scheme - bool inOverwriteMode = options.overwriteOutputFile; + bool inOverwriteMode = processing->overwriteFile; for (int tries = 0; tries < 100; tries++) { if (tries == 0) { diff --git a/rtgui/batchqueueentry.cc b/rtgui/batchqueueentry.cc index d4d29da0b..d52fe4305 100644 --- a/rtgui/batchqueueentry.cc +++ b/rtgui/batchqueueentry.cc @@ -31,7 +31,7 @@ bool BatchQueueEntry::iconsLoaded(false); Glib::RefPtr BatchQueueEntry::savedAsIcon; -BatchQueueEntry::BatchQueueEntry (rtengine::ProcessingJob* pjob, const rtengine::procparams::ProcParams& pparams, Glib::ustring fname, int prevw, int prevh, Thumbnail* thm) : +BatchQueueEntry::BatchQueueEntry (rtengine::ProcessingJob* pjob, const rtengine::procparams::ProcParams& pparams, Glib::ustring fname, int prevw, int prevh, Thumbnail* thm, bool overwrite) : ThumbBrowserEntryBase(fname), opreview(nullptr), origpw(prevw), @@ -43,7 +43,8 @@ BatchQueueEntry::BatchQueueEntry (rtengine::ProcessingJob* pjob, const rtengine: outFileName(""), sequence(0), forceFormatOpts(false), - fast_pipeline(job->fastPipeline()) + fast_pipeline(job->fastPipeline()), + overwriteFile(overwrite) { thumbnail = thm; diff --git a/rtgui/batchqueueentry.h b/rtgui/batchqueueentry.h index 6aecff945..f3e8c1336 100644 --- a/rtgui/batchqueueentry.h +++ b/rtgui/batchqueueentry.h @@ -56,8 +56,9 @@ public: SaveFormat saveFormat; bool forceFormatOpts; bool fast_pipeline; + bool overwriteFile; - BatchQueueEntry (rtengine::ProcessingJob* job, const rtengine::procparams::ProcParams& pparams, Glib::ustring fname, int prevw, int prevh, Thumbnail* thm = nullptr); + BatchQueueEntry (rtengine::ProcessingJob* job, const rtengine::procparams::ProcParams& pparams, Glib::ustring fname, int prevw, int prevh, Thumbnail* thm = nullptr, bool overwrite = false); ~BatchQueueEntry () override; void refreshThumbnailImage () override; diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 9f4c3b61e..a58e28bef 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -1835,7 +1835,7 @@ BatchQueueEntry* EditorPanel::createBatchQueueEntry () isrc->getImageSource()->getFullSize (fullW, fullH, pparams.coarse.rotate == 90 || pparams.coarse.rotate == 270 ? TR_R90 : TR_NONE); int prevh = BatchQueue::calcMaxThumbnailHeight(); int prevw = int ((size_t)fullW * (size_t)prevh / (size_t)fullH); - return new BatchQueueEntry (job, pparams, openThm->getFileName(), prevw, prevh, openThm); + return new BatchQueueEntry (job, pparams, openThm->getFileName(), prevw, prevh, openThm, options.overwriteOutputFile); } @@ -1928,6 +1928,7 @@ void EditorPanel::saveAsPressed () BatchQueueEntry* bqe = createBatchQueueEntry (); bqe->outFileName = fnameOut; bqe->saveFormat = saveAsDialog->getFormat (); + bqe->overwriteFile = !saveAsDialog->getAutoSuffix(); bqe->forceFormatOpts = saveAsDialog->getForceFormatOpts (); parent->addBatchQueueJob (bqe, saveAsDialog->getToHeadOfQueue ()); fnameOK = true; diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index c400a18e3..2995a0de0 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -1216,7 +1216,7 @@ void FileCatalog::developRequested(const std::vector& tbe, bo // processThumbImage is the processing intensive part, but adding to queue must be ordered //#pragma omp ordered //{ - BatchQueueEntry* bqh = new BatchQueueEntry (pjob, params, fbe->filename, pw, ph, th); + BatchQueueEntry* bqh = new BatchQueueEntry (pjob, params, fbe->filename, pw, ph, th, options.overwriteOutputFile); entries.push_back(bqh); //} }