When using “Export Each Playlist Item”,
then the export dialog pre-selects a file instead of a directory.
That file is never a valid directory, of course.
According to source QDir(directory).absolutePath()
should be a directory.
See src/docks/encodedock.cpp
line 1576:
MultiFileExportDialog dialog(tr("Export Each Playlist Item"), MAIN.playlist(),
QDir(directory).absolutePath(), QFileInfo(MAIN.fileName()).completeBaseName(), m_extension, this);
The directory is set beforehand like this:
QString directory = Settings.encodePath();
if (!m_extension.isEmpty()) {
if (!MAIN.fileName().isEmpty()) {
directory += QString("/%1.%2").arg(QFileInfo(MAIN.fileName()).completeBaseName(), m_extension);
}
} else {
if (!MAIN.fileName().isEmpty()) {
directory += "/" + QFileInfo(MAIN.fileName()).completeBaseName();
}
}
It looks like MAIN.fileName()
is appended to variable directory
, making it refer to a file instead of a directory.
What is the original purpose of the appending?