mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 06:10:03 -06:00
Extract ROM to new folder next to archive
For example if DS_ROMS.zip had game.nds, the directory structure would be: ├── DS_ROMS │ └── game.nds └── DS_ROMS.zip
This commit is contained in:
@ -87,8 +87,9 @@ QVector<QString> ExtractFileFromArchive(const char* path, const char* wantedFile
|
|||||||
return QVector<QString> {"Err", archive_error_string(a)};
|
return QVector<QString> {"Err", archive_error_string(a)};
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* fileToWrite = archive_entry_pathname(entry);
|
QString fileToWrite = QFileInfo(path).absolutePath() + "/" + QFileInfo(dirToWrite).baseName() + "/" + archive_entry_pathname(entry);
|
||||||
std::ofstream(fileToWrite, std::ofstream::binary).write((char*)archiveBuffer.get(), bytesToWrite);
|
|
||||||
|
std::ofstream(fileToWrite.toUtf8().constData(), std::ofstream::binary).write((char*)archiveBuffer.get(), bytesToWrite);
|
||||||
|
|
||||||
archiveBuffer.reset(nullptr);
|
archiveBuffer.reset(nullptr);
|
||||||
archive_read_close(a);
|
archive_read_close(a);
|
||||||
|
Reference in New Issue
Block a user