mirror of
https://github.com/ModOrganizer2/modorganizer-plugin_python.git
synced 2026-07-27 14:03:33 -07:00
Move sipAPI getter function to a shared header so it isn't duplicated.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#include "gilock.h"
|
||||
#include <QUrl>
|
||||
#include <QWidget>
|
||||
#include <sip.h>
|
||||
#include "sipApiAccess.h"
|
||||
|
||||
namespace boost
|
||||
{
|
||||
@@ -491,17 +491,6 @@ std::set<QString> IPluginPreviewWrapper::supportedExtensions() const
|
||||
} PYCATCH;
|
||||
}
|
||||
|
||||
// right now, this is copied and pasted from apythonrunner.cpp, but it should probably be moved int oa shared header
|
||||
static const sipAPIDef *sipAPI()
|
||||
{
|
||||
static const sipAPIDef *sipApi = nullptr;
|
||||
if (sipApi == nullptr) {
|
||||
sipApi = (const sipAPIDef *)PyCapsule_Import("sip._C_API", 0);
|
||||
}
|
||||
|
||||
return sipApi;
|
||||
}
|
||||
|
||||
QWidget *IPluginPreviewWrapper::genFilePreview(const QString &fileName, const QSize &maxSize) const
|
||||
{
|
||||
try {
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <iplugintool.h>
|
||||
#include "uibasewrappers.h"
|
||||
#include "proxypluginwrappers.h"
|
||||
#include "sipApiAccess.h"
|
||||
|
||||
#include <Windows.h>
|
||||
#include <utility.h>
|
||||
@@ -417,17 +418,6 @@ struct stdset_from_python_list
|
||||
};
|
||||
|
||||
|
||||
static const sipAPIDef *sipAPI()
|
||||
{
|
||||
static const sipAPIDef *sipApi = nullptr;
|
||||
if (sipApi == nullptr) {
|
||||
sipApi = (const sipAPIDef *)PyCapsule_Import("sip._C_API", 0);
|
||||
}
|
||||
|
||||
return sipApi;
|
||||
}
|
||||
|
||||
|
||||
struct IModRepositoryBridge_to_python
|
||||
{
|
||||
static PyObject *convert(IModRepositoryBridge *bridge)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#include <sip.h>
|
||||
|
||||
static const sipAPIDef *sipAPI()
|
||||
{
|
||||
static const sipAPIDef *sipApi = nullptr;
|
||||
if (sipApi == nullptr) {
|
||||
sipApi = (const sipAPIDef *)PyCapsule_Import("sip._C_API", 0);
|
||||
}
|
||||
|
||||
return sipApi;
|
||||
}
|
||||
Reference in New Issue
Block a user