1
Fork 0
mirror of https://github.com/redstrate/Novus.git synced 2025-04-25 05:17:44 +00:00

Ensure mdl folder exists before export

This commit is contained in:
Joshua Goins 2023-12-31 10:31:21 -05:00
parent 693a47cf4e
commit 3820b77ace

View file

@ -351,8 +351,14 @@ void SingleGearView::importModel(const QString &filename)
KConfigGroup game = config.group(QStringLiteral("Armoury"));
QString outputDirectory = game.readEntry(QStringLiteral("PenumbraOutputDirectory"));
QFileInfo info(QStringLiteral("%1/%2").arg(outputDirectory, gearView->getLoadedGearPath()));
auto buffer = physis_mdl_write(&mdl.model);
QFile file(QStringLiteral("%1/%2").arg(outputDirectory, gearView->getLoadedGearPath()));
if (!QDir().exists(info.absolutePath()))
QDir().mkpath(info.absolutePath());
file.open(QIODevice::WriteOnly);
file.write(reinterpret_cast<char *>(buffer.data), buffer.size);
file.close();