diff options
author | Renato Filho <renato.filho@openbossa.org> | 2011-08-10 16:07:13 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:17:10 -0300 |
commit | a1a8ea866cb039854190da70332717e816908d65 (patch) | |
tree | 07be6898c1228f4913cf9acf244a73c4a5cc01d4 /generator | |
parent | 9c6b541ceef3039e9e19a1d9a12223851a849cf6 (diff) |
Functions marked as deprecated will raises a python warning.
Fixes bug #873.
Diffstat (limited to 'generator')
-rw-r--r-- | generator/cppgenerator.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp index 30fe65f1c..979cc532a 100644 --- a/generator/cppgenerator.cpp +++ b/generator/cppgenerator.cpp @@ -1833,6 +1833,13 @@ void CppGenerator::writeFunctionCalls(QTextStream& s, const OverloadData& overlo void CppGenerator::writeSingleFunctionCall(QTextStream& s, const OverloadData& overloadData, const AbstractMetaFunction* func) { + if (func->isDeprecated()) { + qDebug() << "DEPRECATED FUNCTION:" << func->signature(); + s << INDENT << "Shiboken::warning(PyExc_DeprecationWarning, 1, \"Function: '" + << func->signature().replace("::", ".") + << "' is marked as deprecated, please check the documentation for more information.\");" << endl; + } + if (func->functionType() == AbstractMetaFunction::EmptyFunction) { s << INDENT << "PyErr_Format(PyExc_TypeError, \"%s is a private method.\", \"" << func->signature().replace("::", ".") << "\");" << endl; s << INDENT << "return " << m_currentErrorCode << ';' << endl; |