diff options
Diffstat (limited to 'sources/pyside6/libpyside')
-rw-r--r-- | sources/pyside6/libpyside/feature_select.cpp | 15 | ||||
-rw-r--r-- | sources/pyside6/libpyside/pyside.cpp | 7 |
2 files changed, 4 insertions, 18 deletions
diff --git a/sources/pyside6/libpyside/feature_select.cpp b/sources/pyside6/libpyside/feature_select.cpp index 17c6169af..695a0e61e 100644 --- a/sources/pyside6/libpyside/feature_select.cpp +++ b/sources/pyside6/libpyside/feature_select.cpp @@ -153,16 +153,6 @@ static inline PyObject *getSelectId(PyObject *dict) return select_id; } -static inline void setCurrentSelectId(PyTypeObject *type, PyObject *select_id) -{ - SbkObjectType_SetReserved(type, PyLong_AsSsize_t(select_id)); -} - -static inline void setCurrentSelectId(PyTypeObject *type, int id) -{ - SbkObjectType_SetReserved(type, id); -} - static bool replaceClassDict(PyTypeObject *type) { /* @@ -184,7 +174,6 @@ static bool replaceClassDict(PyTypeObject *type) // Replace `__dict__` which usually has refcount 1 (but see cyclic_test.py) Py_DECREF(type->tp_dict); type->tp_dict = new_dict; - setCurrentSelectId(type, select_id.object()); return true; } @@ -205,7 +194,6 @@ static bool addNewDict(PyTypeObject *type, PyObject *select_id) setNextDict(dict, new_dict); setNextDict(new_dict, next_dict); type->tp_dict = new_dict; - setCurrentSelectId(type, select_id); return true; } @@ -222,13 +210,11 @@ static inline bool moveToFeatureSet(PyTypeObject *type, PyObject *select_id) // This works because small numbers are singleton objects. if (current_id == select_id) { type->tp_dict = dict; - setCurrentSelectId(type, select_id); return true; } dict = nextInCircle(dict); } while (dict != initial_dict); type->tp_dict = initial_dict; - setCurrentSelectId(type, getSelectId(initial_dict)); return false; } @@ -261,7 +247,6 @@ static bool createNewFeatureSet(PyTypeObject *type, PyObject *select_id) auto id = PyLong_AsSsize_t(select_id); if (id == -1) return false; - setCurrentSelectId(type, id); FeatureProc *proc = featurePointer; for (int idx = id; *proc != nullptr; ++proc, idx >>= 1) { if (idx & 1) { diff --git a/sources/pyside6/libpyside/pyside.cpp b/sources/pyside6/libpyside/pyside.cpp index 672f990bb..a832db28a 100644 --- a/sources/pyside6/libpyside/pyside.cpp +++ b/sources/pyside6/libpyside/pyside.cpp @@ -31,6 +31,7 @@ #include <sbkconverter.h> #include <sbkstring.h> #include <sbkstaticstrings.h> +#include <sbkfeature_base.h> #include <QtCore/QByteArray> #include <QtCore/QCoreApplication> @@ -232,7 +233,7 @@ static bool _setProperty(PyObject *qObj, PyObject *name, PyObject *value, bool * QByteArray propName(Shiboken::String::toCString(name)); auto type = Py_TYPE(qObj); - int flags = SbkObjectType_GetReserved(type); + int flags = currentSelectId(type); int prop_flag = flags & 0x02; auto found = false; QByteArray getterName{}, setterName{}; @@ -301,7 +302,7 @@ bool fillQtProperties(PyObject *qObj, const QMetaObject *metaObj, PyObject *kwds PyObject *key, *value; Py_ssize_t pos = 0; - int flags = SbkObjectType_GetReserved(Py_TYPE(qObj)); + int flags = currentSelectId(Py_TYPE(qObj)); int snake_flag = flags & 0x01; while (PyDict_Next(kwds, &pos, &key, &value)) { @@ -517,7 +518,7 @@ PyObject *getMetaDataFromQObject(QObject *cppSelf, PyObject *self, PyObject *nam PyErr_Fetch(&type, &value, &traceback); // This was omitted for a loong time. const char *cname = Shiboken::String::toCString(name); - int flags = SbkObjectType_GetReserved(Py_TYPE(self)); + int flags = currentSelectId(Py_TYPE(self)); int snake_flag = flags & 0x01; uint cnameLen = qstrlen(cname); if (std::strncmp("__", cname, 2)) { |