Skip to content

Commit

Permalink
fixed so files are actually copied
Browse files Browse the repository at this point in the history
  • Loading branch information
JMPZ11 committed Jun 18, 2024
1 parent 6a6a402 commit a2eb958
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/spells/meshfilecopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,15 @@ void spResourceCopy::copyPaths(NifModel* nif, NifItem* item, const QString& auth
QString oldPath = QDir(nifFolder).filePath("geometries/" + meshPath + ".mesh");
QString newPath = QDir(nifFolder).filePath("geometries/" + newMeshPath + ".mesh");

// Create the directory for the new path if it doesn't exist
QDir newDir = QFileInfo(newPath).absoluteDir();
newDir.mkpath(newDir.absolutePath());

// Copy the file (platform-independent with the slashes)
QFile::copy(QDir::fromNativeSeparators(oldPath), QDir::fromNativeSeparators(newPath));

// Update the value in the nif
findChildByName(mesh,"Mesh Path")->setValueFromString(newMeshPath);
//nif->set<QString>(mesh,"Mesh Path",newMeshPath);
//mesh->setValueFromString(newMeshPath);
}
}
}
Expand Down

0 comments on commit a2eb958

Please sign in to comment.