mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-25 13:17:46 +00:00
Ensure mdl folder exists before export
This commit is contained in:
parent
693a47cf4e
commit
3820b77ace
1 changed files with 6 additions and 0 deletions
|
@ -351,8 +351,14 @@ void SingleGearView::importModel(const QString &filename)
|
||||||
KConfigGroup game = config.group(QStringLiteral("Armoury"));
|
KConfigGroup game = config.group(QStringLiteral("Armoury"));
|
||||||
QString outputDirectory = game.readEntry(QStringLiteral("PenumbraOutputDirectory"));
|
QString outputDirectory = game.readEntry(QStringLiteral("PenumbraOutputDirectory"));
|
||||||
|
|
||||||
|
QFileInfo info(QStringLiteral("%1/%2").arg(outputDirectory, gearView->getLoadedGearPath()));
|
||||||
|
|
||||||
auto buffer = physis_mdl_write(&mdl.model);
|
auto buffer = physis_mdl_write(&mdl.model);
|
||||||
QFile file(QStringLiteral("%1/%2").arg(outputDirectory, gearView->getLoadedGearPath()));
|
QFile file(QStringLiteral("%1/%2").arg(outputDirectory, gearView->getLoadedGearPath()));
|
||||||
|
|
||||||
|
if (!QDir().exists(info.absolutePath()))
|
||||||
|
QDir().mkpath(info.absolutePath());
|
||||||
|
|
||||||
file.open(QIODevice::WriteOnly);
|
file.open(QIODevice::WriteOnly);
|
||||||
file.write(reinterpret_cast<char *>(buffer.data), buffer.size);
|
file.write(reinterpret_cast<char *>(buffer.data), buffer.size);
|
||||||
file.close();
|
file.close();
|
||||||
|
|
Loading…
Add table
Reference in a new issue