Fix shared_ptr in createFile().

This commit is contained in:
Mikaël Capelle
2022-01-11 22:36:16 +01:00
parent 071498f305
commit 0c5622ea69
+3 -1
View File
@@ -664,7 +664,9 @@ BOOST_PYTHON_MODULE(mobase)
.def("getSupportedExtensions", &IInstallationManager::getSupportedExtensions)
.def("extractFile", &IInstallationManager::extractFile, (bpy::arg("entry"), bpy::arg("silent") = false))
.def("extractFiles", &IInstallationManager::extractFiles, (bpy::arg("entries"), bpy::arg("silent") = false))
.def("createFile", &IInstallationManager::createFile, bpy::arg("entry"))
.def("createFile", +[](IInstallationManager* m, std::shared_ptr<const MOBase::FileTreeEntry> entry) {
return m->createFile(utils::clean_shared_ptr(entry));
}, bpy::arg("entry"))
// accept both QString and GuessedValue<QString> since the conversion is not automatic in Python, and
// return a tuple to get back the mod name and the mod ID