Replace ? characters when copying files to devices (since they're invalid on FAT32 filesystems), and check the return value of QDir::mkpath. Fixes issue #721.
This commit is contained in:
parent
38cfedb3d2
commit
e95c4979f8
|
@ -32,8 +32,12 @@ bool FilesystemMusicStorage::CopyToStorage(const CopyJob& job) {
|
|||
return true;
|
||||
|
||||
// Create directories as required
|
||||
const QString dest_directory = dest_filename.section('/', 0, -2);
|
||||
QDir dir;
|
||||
dir.mkpath(dest_filename.section('/', 0, -2));
|
||||
if (!dir.mkpath(dest_directory)) {
|
||||
qWarning() << "Failed to create directory" << dest_directory;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Remove the destination file if it exists and we want to overwrite
|
||||
if (job.overwrite_ && QFile::exists(dest_filename))
|
||||
|
|
|
@ -154,6 +154,7 @@ QString OrganiseFormat::TagValue(const QString &tag, const Song &song) const {
|
|||
// Replace characters that really shouldn't be in paths
|
||||
value.replace('/', '_');
|
||||
value.replace('\\', '_');
|
||||
value.replace('?', '_');
|
||||
|
||||
return value;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue