aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside/pysideproperty.cpp
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2022-01-17 13:20:46 +0100
committerChristian Tismer <tismer@stackless.com>2022-02-03 18:18:04 +0100
commit5a487a6f9f9861fc14458c770e61c66a63019184 (patch)
tree9af8ca3015ae585905a14bb5597f6309472c7b63 /sources/pyside6/libpyside/pysideproperty.cpp
parentac1dbba1798bc72cf4e71142ec6f647b8b6ae25d (diff)
PyPySide: Rename interface functions and classes to simplify debugging
The names of certain interface functions are not always following a simple scheme. Especially it is not easy to see immediately if we are dealing with a method of SbkObjectType or SbkObject Do a few renamings to simplify debugging and make the code easier to understand. When a function is used in a type spec and there is no other important reason, it should be named like {Py_<tpname>: reinterpret_cast<void *>(<TypeName>_<tpname>)}, Rename also all type functions ending on "TypeF()" to end in "_TypeF()". This is not always the case. Examples: SbkObjectTpNew -> SbkObject_tp_new SbkObjecttypeTpNew -> SbkObjectType_tp_new PyClassPropertyTypeF -> PyClassProperty_TypeF Task-number: PYSIDE-535 Change-Id: Icbd118852f2ee732b55d944ed57c7a8ef7d26139 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/libpyside/pysideproperty.cpp')
-rw-r--r--sources/pyside6/libpyside/pysideproperty.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/sources/pyside6/libpyside/pysideproperty.cpp b/sources/pyside6/libpyside/pysideproperty.cpp
index 8ea3c2407..8053a63ba 100644
--- a/sources/pyside6/libpyside/pysideproperty.cpp
+++ b/sources/pyside6/libpyside/pysideproperty.cpp
@@ -115,7 +115,7 @@ static PyType_Spec PySidePropertyType_spec = {
};
-PyTypeObject *PySidePropertyTypeF(void)
+PyTypeObject *PySideProperty_TypeF(void)
{
static auto *type = SbkType_FromSpec(&PySidePropertyType_spec);
return type;
@@ -358,7 +358,7 @@ static PyObject *qPropertyDocGet(PyObject *self, void *)
if (!get_doc.isNull()) {
pData->doc = String::toCString(get_doc);
pData->getter_doc = true;
- if (Py_TYPE(self) == PySidePropertyTypeF())
+ if (Py_TYPE(self) == PySideProperty_TypeF())
return qPropertyDocGet(self, nullptr);
/*
* If this is a property subclass, put __doc__ in dict of the
@@ -459,17 +459,17 @@ static const char *Property_SignatureStrings[] = {
void init(PyObject *module)
{
- if (InitSignatureStrings(PySidePropertyTypeF(), Property_SignatureStrings) < 0)
+ if (InitSignatureStrings(PySideProperty_TypeF(), Property_SignatureStrings) < 0)
return;
- Py_INCREF(PySidePropertyTypeF());
- PyModule_AddObject(module, "Property", reinterpret_cast<PyObject *>(PySidePropertyTypeF()));
+ Py_INCREF(PySideProperty_TypeF());
+ PyModule_AddObject(module, "Property", reinterpret_cast<PyObject *>(PySideProperty_TypeF()));
}
bool checkType(PyObject *pyObj)
{
if (pyObj) {
- return PyType_IsSubtype(Py_TYPE(pyObj), PySidePropertyTypeF());
+ return PyType_IsSubtype(Py_TYPE(pyObj), PySideProperty_TypeF());
}
return false;
}