[win] Fix File > Export > Export As to other drive (fix #4607)

This only affects the Windows platform.
Regression introduced in db639072f7
This commit is contained in:
David Capello 2024-08-21 13:50:29 -03:00
parent 8817724e44
commit 1ca4306f9d

View File

@ -199,6 +199,12 @@ void ExportFileWindow::setOutputFilename(const std::string& pathAndFilename)
else { else {
m_outputPath = base::get_file_path(m_doc->filename()); m_outputPath = base::get_file_path(m_doc->filename());
m_outputFilename = base::get_relative_path(pathAndFilename, base::get_file_path(m_doc->filename())); m_outputFilename = base::get_relative_path(pathAndFilename, base::get_file_path(m_doc->filename()));
// Cannot find a relative path (e.g. we selected other drive)
if (m_outputFilename == pathAndFilename) {
m_outputPath = base::get_file_path(pathAndFilename);
m_outputFilename = base::get_file_name(pathAndFilename);
}
} }
updateOutputFilenameEntry(); updateOutputFilenameEntry();