diff --git a/src/mobase/wrappers/basic_classes.cpp b/src/mobase/wrappers/basic_classes.cpp index bdeecaa..de28e71 100644 --- a/src/mobase/wrappers/basic_classes.cpp +++ b/src/mobase/wrappers/basic_classes.cpp @@ -3,6 +3,7 @@ #include "../pybind11_all.h" #include +#include #include #include @@ -536,6 +537,7 @@ namespace mo2::python { py::class_(m, "IOrganizer") .def("createNexusBridge", &IOrganizer::createNexusBridge, py::return_value_policy::reference) + .def("instanceName", &IOrganizer::instanceName) .def("profileName", &IOrganizer::profileName) .def("profilePath", &IOrganizer::profilePath) .def("downloadsPath", &IOrganizer::downloadsPath) @@ -625,7 +627,9 @@ namespace mo2::python { .def("modList", &IOrganizer::modList, py::return_value_policy::reference) .def("gameFeatures", &IOrganizer::gameFeatures, py::return_value_policy::reference) - .def("profile", &IOrganizer::profile, py::return_value_policy::reference) + .def("profile", &IOrganizer::profile) + .def("profileNames", &IOrganizer::profileNames) + .def("getProfile", &IOrganizer::getProfile, "name"_a) // custom implementation for startApplication and // waitForApplication because 1) HANDLE (= void*) is not properly @@ -880,7 +884,7 @@ namespace mo2::python { // must be done BEFORE imodlist because there is a default argument to a // IProfile* in the modlist class - py::class_(m, "IProfile") + py::class_>(m, "IProfile") .def("name", &IProfile::name) .def("absolutePath", &IProfile::absolutePath) .def("localSavesEnabled", &IProfile::localSavesEnabled) diff --git a/tests/mocks/MockOrganizer.h b/tests/mocks/MockOrganizer.h index cdae36a..6508fc0 100644 --- a/tests/mocks/MockOrganizer.h +++ b/tests/mocks/MockOrganizer.h @@ -7,6 +7,7 @@ class MockOrganizer : public IOrganizer { public: // clang-format off MOCK_METHOD(IModRepositoryBridge*, createNexusBridge, (), (const, override)); + MOCK_METHOD(QString, instanceName, (), (const, override)); MOCK_METHOD(QString, profileName, (), (const, override)); MOCK_METHOD(QString, profilePath, (), (const, override)); MOCK_METHOD(QString, downloadsPath, (), (const, override)); @@ -36,7 +37,9 @@ class MockOrganizer : public IOrganizer { MOCK_METHOD(MOBase::IDownloadManager*, downloadManager, (), (const, override)); MOCK_METHOD(MOBase::IPluginList*, pluginList, (), (const, override)); MOCK_METHOD(MOBase::IModList*, modList, (), (const, override)); - MOCK_METHOD(MOBase::IProfile*, profile, (), (const, override)); + MOCK_METHOD(std::shared_ptr, profile, (), (const, override)); + MOCK_METHOD(QStringList, profileNames, (), (const, override)); + MOCK_METHOD(std::shared_ptr, getProfile, (const QString& name), (const, override)); MOCK_METHOD(MOBase::IGameFeatures*, gameFeatures, (), (const, override)); MOCK_METHOD(HANDLE, startApplication, (const QString &executable, const QStringList &args, const QString &cwd, const QString &profile, const QString &forcedCustomOverwrite, bool ignoreCustomOverwrite), (override)); MOCK_METHOD(bool, waitForApplication, (HANDLE handle, bool refresh, LPDWORD exitCode), (const, override));