From 9ad4bb55956e2925484ee86890fb26f4726c5425 Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 3 May 2013 21:23:34 +0200 Subject: [PATCH] Mark attribute 'Type' deprecated, use 'TypeId' now --- src/Base/BaseClassPy.xml | 8 +++++++- src/Base/BaseClassPyImp.cpp | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Base/BaseClassPy.xml b/src/Base/BaseClassPy.xml index 7795e901a..661816822 100644 --- a/src/Base/BaseClassPy.xml +++ b/src/Base/BaseClassPy.xml @@ -26,10 +26,16 @@ - Is the type of the FreeCAD object with module domain + Is the type of the FreeCAD object with module domain (deprecated use TypeId) + + + Is the type of the FreeCAD object with module domain + + + Module in which this class is defined diff --git a/src/Base/BaseClassPyImp.cpp b/src/Base/BaseClassPyImp.cpp index 8ba276066..879123c71 100644 --- a/src/Base/BaseClassPyImp.cpp +++ b/src/Base/BaseClassPyImp.cpp @@ -69,6 +69,13 @@ PyObject* BaseClassPy::getAllDerivedFrom(PyObject *args) } Py::String BaseClassPy::getType(void) const +{ + PyErr_SetString(PyExc_DeprecationWarning, "Use 'TypeId' instead"); + PyErr_Print(); + return Py::String(std::string(getBaseClassPtr()->getTypeId().getName())); +} + +Py::String BaseClassPy::getTypeId(void) const { return Py::String(std::string(getBaseClassPtr()->getTypeId().getName())); }