From df4102846831f67aa960d7ff74346014f92be85b Mon Sep 17 00:00:00 2001 From: Scott Gilbertson Date: Sun, 7 Jan 2024 11:10:05 -0500 Subject: [PATCH] On Windows, use backslashes in template-generated paths (but continue to accept either / or \ in input strings, on any platform) Also deleted an unused helper function. --- rtgui/batchqueue.cc | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index cb9127333..61f1c082d 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -43,6 +43,12 @@ using namespace std; using namespace rtengine; +#ifdef _WIN32 +#define PATH_SEPARATOR '\\'; +#else +#define PATH_SEPARATOR '/'; +#endif + BatchQueue::BatchQueue (FileCatalog* aFileCatalog) : processing(nullptr), fileCatalog(aFileCatalog), sequence(0), listener(nullptr) { @@ -824,17 +830,6 @@ rtengine::ProcessingJob* BatchQueue::imageReady(rtengine::IImagefloat* img) return processing ? processing->job : nullptr; } -// Combine a range of elements from "names" into a slash-delimited path -static inline Glib::ustring combineDirectoryNames(unsigned startIndex, unsigned endIndex, const std::vector & names) -{ - Glib::ustring resultPath; - for (unsigned i = startIndex; i <= endIndex && i < names.size(); ++i) - { - resultPath = resultPath + names[i] + '/'; - } - return resultPath; -} - // Look for N or -N in templateText at position ix, meaning "index from end" and "index from start" // For N, return Nth index from the end, and for -N return the Nth index from the start // N is a digit 1 through 9 @@ -926,7 +921,7 @@ Glib::ustring BatchQueue::calcAutoFileNameBase (const Glib::ustring& origFileNam unsigned n = decodePathIndex(ix, options.savePathTemplate, da.size()); if (n < da.size()) { for (unsigned i=n; i