Skip to content

Commit a4338db

Browse files
committed
Fix after rebasing.
1 parent 9b1793c commit a4338db

File tree

8 files changed

+17
-36
lines changed

8 files changed

+17
-36
lines changed

src/mobase/wrappers/basic_classes.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include <format>
66

77
#include <uibase/executableinfo.h>
8+
#include <uibase/extensions/extension.h>
9+
#include <uibase/extensions/iextensionlist.h>
810
#include <uibase/filemapping.h>
911
#include <uibase/game_features/igamefeatures.h>
1012
#include <uibase/guessedvalue.h>
@@ -590,6 +592,8 @@ namespace mo2::python {
590592
py::return_value_policy::reference)
591593
.def("pluginList", &IOrganizer::pluginList,
592594
py::return_value_policy::reference)
595+
.def("extensionList", &IOrganizer::extensionList,
596+
py::return_value_policy::reference)
593597
.def("modList", &IOrganizer::modList, py::return_value_policy::reference)
594598
.def("gameFeatures", &IOrganizer::gameFeatures,
595599
py::return_value_policy::reference)

src/mobase/wrappers/pyplugins.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,6 @@ namespace mo2::python {
144144
.def("init", &IPlugin::init, "organizer"_a)
145145
.def("name", &IPlugin::name)
146146
.def("localizedName", &IPlugin::localizedName)
147-
.def("master", &IPlugin::master)
148-
.def("author", &IPlugin::author)
149-
.def("description", &IPlugin::description)
150-
.def("version", &IPlugin::version)
151-
.def("requirements", &IPlugin::requirements)
152147
.def("settings", &IPlugin::settings)
153148
.def("enabledByDefault", &IPlugin::enabledByDefault);
154149

src/mobase/wrappers/pyplugins.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,6 @@ namespace mo2::python {
4545
{
4646
PYBIND11_OVERRIDE(QString, PluginBase, localizedName, );
4747
}
48-
QString master() const override
49-
{
50-
PYBIND11_OVERRIDE(QString, PluginBase, master, );
51-
}
52-
QString author() const override
53-
{
54-
PYBIND11_OVERRIDE_PURE(QString, PluginBase, author, );
55-
}
56-
QString description() const override
57-
{
58-
PYBIND11_OVERRIDE_PURE(QString, PluginBase, description, );
59-
}
60-
VersionInfo version() const override
61-
{
62-
PYBIND11_OVERRIDE_PURE(VersionInfo, PluginBase, version, );
63-
}
6448
QList<PluginSetting> settings() const override
6549
{
6650
PYBIND11_OVERRIDE_PURE(QList<PluginSetting>, PluginBase, settings, );

src/plugin_python_en.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,35 @@
44
<context>
55
<name>ProxyPython</name>
66
<message>
7-
<location filename="proxy/proxypython.cpp" line="156"/>
8-
<source>The path to Mod Organizer (%1) contains a semicolon. &lt;br&gt;While this is legal on NTFS drives, many softwares do not handle it correctly.&lt;br&gt;Unfortunately MO depends on libraries that seem to fall into that group.&lt;br&gt;As a result the python plugin cannot be loaded, and the only solution we canoffer is to remove the semicolon or move MO to a path without a semicolon.</source>
7+
<location filename="proxy/proxypython.cpp" line="170"/>
8+
<source>The path to Mod Organizer (%1) contains a semicolon.&lt;br&gt;While this is legal on NTFS drives, many applications do not handle it correctly.&lt;br&gt;Unfortunately MO depends on libraries that seem to fall into that group.&lt;br&gt;As a result the python plugin cannot be loaded, and the only solution we can offer is to remove the semicolon or move MO to a path without a semicolon.</source>
99
<translation type="unfinished"></translation>
1010
</message>
1111
<message>
12-
<location filename="proxy/proxypython.cpp" line="167"/>
12+
<location filename="proxy/proxypython.cpp" line="180"/>
1313
<source>The Python plugin DLL was not found, maybe your antivirus deleted it. Re-installing MO2 might fix the problem.</source>
1414
<translation type="unfinished"></translation>
1515
</message>
1616
<message>
17-
<location filename="proxy/proxypython.cpp" line="170"/>
17+
<location filename="proxy/proxypython.cpp" line="183"/>
1818
<source>The Python plugin DLL is invalid, maybe your antivirus is blocking it. Re-installing MO2 and adding exclusions for it to your AV might fix the problem.</source>
1919
<translation type="unfinished"></translation>
2020
</message>
2121
<message>
22-
<location filename="proxy/proxypython.cpp" line="174"/>
22+
<location filename="proxy/proxypython.cpp" line="188"/>
2323
<source>The initialization of the Python plugin DLL failed, unfortunately without any details.</source>
2424
<translation type="unfinished"></translation>
2525
</message>
2626
<message>
27-
<location filename="proxy/proxypython.cpp" line="177"/>
27+
<location filename="proxy/proxypython.cpp" line="191"/>
2828
<source>no failure</source>
2929
<translation type="unfinished"></translation>
3030
</message>
3131
</context>
3232
<context>
3333
<name>QObject</name>
3434
<message>
35-
<location filename="runner/error.h" line="77"/>
35+
<location filename="runner/error.h" line="76"/>
3636
<source>An unknown exception was thrown in python code.</source>
3737
<translation type="unfinished"></translation>
3838
</message>

src/proxy/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mo2_configure_plugin(proxy
99
NO_SOURCES
1010
WARNINGS 4
1111
EXTERNAL_WARNINGS 4
12-
TRANSLATIONS ON
12+
TRANSLATIONS OFF
1313
EXTRA_TRANSLATIONS
1414
${CMAKE_CURRENT_SOURCE_DIR}/../runner
1515
${CMAKE_CURRENT_SOURCE_DIR}/../mobase
@@ -21,8 +21,8 @@ set_target_properties(proxy PROPERTIES OUTPUT_NAME "python_proxy")
2121
set(PROXY_PYTHON_DIR ${MO2_INSTALL_BIN}/proxies/python)
2222

2323
# install runner and proxy
24-
install(FILES $<TARGET_FILE:proxy> DESTINATION ${PROXY_PYTHON_DIR}/python)
25-
install(FILES $<TARGET_FILE:runner> DESTINATION ${PROXY_PYTHON_DIR}/python/dlls)
24+
install(FILES $<TARGET_FILE:proxy> DESTINATION ${PROXY_PYTHON_DIR})
25+
install(FILES $<TARGET_FILE:runner> DESTINATION ${PROXY_PYTHON_DIR}/dlls)
2626

2727
# install PDB
2828
install(FILES $<TARGET_PDB_FILE:proxy> DESTINATION pdb)
@@ -32,7 +32,7 @@ target_link_options(proxy PRIVATE "/DELAYLOAD:runner.dll")
3232

3333
# translations (custom location)
3434
mo2_add_translations(proxy
35-
TS_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../${PLUGIN_NAME}_en.ts
35+
TS_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../plugin_python_en.ts
3636
SOURCES
3737
${CMAKE_CURRENT_SOURCE_DIR}
3838
${CMAKE_CURRENT_SOURCE_DIR}/../runner

src/runner/pythonrunner.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <QString>
1010
#include <QStringList>
1111

12-
#include <extension.h>
12+
#include <uibase/extensions/extension.h>
1313

1414
#ifdef RUNNER_BUILD
1515
#define RUNNER_DLL_EXPORT Q_DECL_EXPORT

tests/mocks/MockOrganizer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class MockOrganizer : public IOrganizer {
3535
MOCK_METHOD(std::shared_ptr<const IFileTree>, virtualFileTree, (), (const, override));
3636
MOCK_METHOD(MOBase::IDownloadManager*, downloadManager, (), (const, override));
3737
MOCK_METHOD(MOBase::IPluginList*, pluginList, (), (const, override));
38+
MOCK_METHOD(MOBase::IExtensionList&, extensionList, (), (const, override));
3839
MOCK_METHOD(MOBase::IModList*, modList, (), (const, override));
3940
MOCK_METHOD(MOBase::IProfile*, profile, (), (const, override));
4041
MOCK_METHOD(MOBase::IGameFeatures*, gameFeatures, (), (const, override));

tests/runner/test_iplugin.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ TEST(IPlugin, Basic)
2626
const IPlugin* plugin = qobject_cast<IPlugin*>(objects[0][0]);
2727
EXPECT_NE(plugin, nullptr);
2828

29-
EXPECT_EQ(plugin->author(), "The Author");
3029
EXPECT_EQ(plugin->name(), "The Name");
31-
EXPECT_EQ(plugin->version(), VersionInfo(1, 3, 0));
32-
EXPECT_EQ(plugin->description(), "The Description");
3330

3431
// settings
3532
const auto settings = plugin->settings();

0 commit comments

Comments
 (0)