diff --git a/src/mobase/pybind11_all.h b/src/mobase/pybind11_all.h index 9f317bd..5813616 100644 --- a/src/mobase/pybind11_all.h +++ b/src/mobase/pybind11_all.h @@ -83,9 +83,9 @@ namespace mo2::python { MO2_PYBIND11_SHARED_CPP_HOLDER(MOBase::IPluginRequirement) MO2_PYBIND11_SHARED_CPP_HOLDER(MOBase::ISaveGame) -MO2_PYBIND11_WRAP_ARGUMENT_CASTER(mo2::python::FileWrapper, QFileInfo, - std::filesystem::path, QString); -MO2_PYBIND11_WRAP_ARGUMENT_CASTER(mo2::python::DirectoryWrapper, QDir, +MO2_PYBIND11_WRAP_ARGUMENT_CASTER(mo2::python::FileWrapper, "FileWrapper", QFileInfo, std::filesystem::path, QString); +MO2_PYBIND11_WRAP_ARGUMENT_CASTER(mo2::python::DirectoryWrapper, "DirectoryWrapper", + QDir, std::filesystem::path, QString); #endif diff --git a/src/pybind11-utils/include/pybind11_utils/arg_wrapper.h b/src/pybind11-utils/include/pybind11_utils/arg_wrapper.h index 9f92b78..3ab49d0 100644 --- a/src/pybind11-utils/include/pybind11_utils/arg_wrapper.h +++ b/src/pybind11-utils/include/pybind11_utils/arg_wrapper.h @@ -126,11 +126,11 @@ namespace mo2::python { } // namespace mo2::python -#define MO2_PYBIND11_WRAP_ARGUMENT_CASTER(Type, ...) \ +#define MO2_PYBIND11_WRAP_ARGUMENT_CASTER(Type, Name, ...) \ namespace pybind11::detail { \ template <> \ struct type_caster { \ - PYBIND11_TYPE_CASTER(Type, const_name(#Type)); \ + PYBIND11_TYPE_CASTER(Type, const_name(Name)); \ bool load(handle src, bool convert) \ { \ return mo2::python::detail::load_wrapped_argument_helper< \ diff --git a/tests/python/test_argument_wrapper.cpp b/tests/python/test_argument_wrapper.cpp index 77a04ec..8c2a939 100644 --- a/tests/python/test_argument_wrapper.cpp +++ b/tests/python/test_argument_wrapper.cpp @@ -28,7 +28,7 @@ public: operator std::string() const { return value; } }; -MO2_PYBIND11_WRAP_ARGUMENT_CASTER(Wrapper, int, std::string); +MO2_PYBIND11_WRAP_ARGUMENT_CASTER(Wrapper, "Wrapper", int, std::string); template auto wrap(Fn&& fn)