aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-07-08 17:26:56 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2010-07-08 17:26:56 -0300
commit9e005dea1040dbfa7d1746fe6fa64ab2c0e07f1a (patch)
treea48a2b933780b060610afc9bbeeb5a0c4b425a89
parent0e2f7543d283f37cd5c47028b663b415572f576f (diff)
Removed deprecated methods.
-rw-r--r--generator.cpp152
-rw-r--r--generator.h30
-rw-r--r--generators/qtdoc/qtdocgenerator.cpp4
3 files changed, 2 insertions, 184 deletions
diff --git a/generator.cpp b/generator.cpp
index 47039240..3c0b2ec1 100644
--- a/generator.cpp
+++ b/generator.cpp
@@ -199,24 +199,6 @@ void verifyDirectoryFor(const QFile &file)
}
}
-bool Generator::hasDefaultConstructor(const AbstractMetaType *type)
-{
- QString full_name = type->typeEntry()->qualifiedTargetLangName();
- QString class_name = type->typeEntry()->targetLangName();
-
- foreach (const AbstractMetaClass *cls, m_d->apiextractor->classes()) {
- if (cls->typeEntry()->qualifiedTargetLangName() == full_name) {
- AbstractMetaFunctionList functions = cls->functions();
- foreach (const AbstractMetaFunction *function, functions) {
- if (function->arguments().isEmpty() && function->name() == class_name)
- return true;
- }
- return false;
- }
- }
- return false;
-}
-
void Generator::replaceTemplateVariables(QString &code, const AbstractMetaFunction *func)
{
const AbstractMetaClass *cpp_class = func->ownerClass();
@@ -245,122 +227,6 @@ void Generator::replaceTemplateVariables(QString &code, const AbstractMetaFuncti
}
}
-AbstractMetaFunctionList Generator::queryFunctions(const AbstractMetaClass *cppClass, bool allFunctions)
-{
- AbstractMetaFunctionList result;
-
- if (allFunctions) {
- int default_flags = AbstractMetaClass::NormalFunctions | AbstractMetaClass::Visible;
- default_flags |= cppClass->isInterface() ? 0 : AbstractMetaClass::ClassImplements;
-
- // Constructors
- result = cppClass->queryFunctions(AbstractMetaClass::Constructors |
- default_flags);
-
- // put enum constructor first to avoid conflict with int contructor
- result = sortConstructor(result);
-
- // Final functions
- result += cppClass->queryFunctions(AbstractMetaClass::FinalInTargetLangFunctions |
- AbstractMetaClass::NonStaticFunctions |
- default_flags);
-
- //virtual
- result += cppClass->queryFunctions(AbstractMetaClass::VirtualInTargetLangFunctions |
- AbstractMetaClass::NonStaticFunctions |
- default_flags);
-
- // Static functions
- result += cppClass->queryFunctions(AbstractMetaClass::StaticFunctions | default_flags);
-
- // Empty, private functions, since they aren't caught by the other ones
- result += cppClass->queryFunctions(AbstractMetaClass::Empty |
- AbstractMetaClass::Invisible | default_flags);
- // Signals
- result += cppClass->queryFunctions(AbstractMetaClass::Signals | default_flags);
- } else {
- result = cppClass->functionsInTargetLang();
- }
-
- return result;
-}
-
-AbstractMetaFunctionList Generator::filterFunctions(const AbstractMetaClass *cppClass)
-{
- AbstractMetaFunctionList lst = queryFunctions(cppClass, true);
- foreach (AbstractMetaFunction *func, lst) {
- //skip signals
- if (func->isSignal() ||
- func->isDestructor() ||
- (func->isModifiedRemoved() && !func->isAbstract())) {
- lst.removeOne(func);
- }
- }
-
- //virtual not implemented in current class
- AbstractMetaFunctionList virtual_lst = cppClass->queryFunctions(AbstractMetaClass::VirtualFunctions);
- foreach (AbstractMetaFunction *func, virtual_lst) {
- if ((func->implementingClass() != cppClass) &&
- !lst.contains(func)) {
- lst.append(func);
- }
- }
-
- //append global operators
- foreach (AbstractMetaFunction *func , queryGlobalOperators(cppClass)) {
- if (!lst.contains(func))
- lst.append(func);
- }
-
- return lst;
- //return cpp_class->functions();
-}
-
-AbstractMetaFunctionList Generator::queryGlobalOperators(const AbstractMetaClass *cppClass)
-{
- AbstractMetaFunctionList result;
-
- foreach (AbstractMetaFunction *func, cppClass->functions()) {
- if (func->isInGlobalScope() && func->isOperatorOverload())
- result.append(func);
- }
- return result;
-}
-
-AbstractMetaFunctionList Generator::sortConstructor(AbstractMetaFunctionList list)
-{
- AbstractMetaFunctionList result;
-
- foreach (AbstractMetaFunction *func, list) {
- bool inserted = false;
- foreach (AbstractMetaArgument *arg, func->arguments()) {
- if (arg->type()->isFlags() || arg->type()->isEnum()) {
- result.push_back(func);
- inserted = true;
- break;
- }
- }
- if (!inserted)
- result.push_front(func);
- }
-
- return result;
-}
-
-FunctionModificationList Generator::functionModifications(const AbstractMetaFunction *metaFunction)
-{
- FunctionModificationList mods;
- const AbstractMetaClass *cls = metaFunction->implementingClass();
- while (cls) {
- mods += metaFunction->modifications(cls);
-
- if (cls == cls->baseClass())
- break;
- cls = cls->baseClass();
- }
- return mods;
-}
-
QTextStream& formatCode(QTextStream &s, const QString& code, Indentor &indentor)
{
// detect number of spaces before the first character
@@ -390,24 +256,6 @@ QTextStream& formatCode(QTextStream &s, const QString& code, Indentor &indentor)
return s;
}
-CodeSnipList Generator::getCodeSnips(const AbstractMetaFunction *func) const
-{
- CodeSnipList result;
- const AbstractMetaClass *cppClass = func->implementingClass();
- while (cppClass) {
- foreach (FunctionModification mod, func->modifications(cppClass)) {
- if (mod.isCodeInjection())
- result << mod.snips;
- }
-
- if (cppClass == cppClass->baseClass())
- break;
- cppClass = cppClass->baseClass();
- }
-
- return result;
-}
-
AbstractMetaFunctionList Generator::implicitConversions(const TypeEntry* type) const
{
if (type->isValue()) {
diff --git a/generator.h b/generator.h
index 602effc4..c4589010 100644
--- a/generator.h
+++ b/generator.h
@@ -254,36 +254,6 @@ protected:
*/
virtual QString subDirectoryForPackage(QString packageName = QString()) const;
- /**
- * @deprecated This function doesn't belongs to the generator world and will sooner be moved to APIExtractor
- */
- static FunctionModificationList functionModifications(const AbstractMetaFunction *meta_function) GENRUNNER_DEPRECATED;
- /**
- * @deprecated This function doesn't belongs to the generator world and will sooner be moved to APIExtractor
- */
- AbstractMetaFunctionList filterFunctions(const AbstractMetaClass *cppClass) GENRUNNER_DEPRECATED;
- /**
- * @deprecated This function doesn't belongs to the generator world and will sooner be moved to APIExtractor
- */
- AbstractMetaFunctionList queryFunctions(const AbstractMetaClass *cpp_class, bool all_function = false) GENRUNNER_DEPRECATED;
- /**
- * @deprecated This function doesn't belongs to the generator world and will sooner be moved to APIExtractor
- */
- AbstractMetaFunctionList queryGlobalOperators(const AbstractMetaClass *cpp_class) GENRUNNER_DEPRECATED;
- /**
- * @deprecated This function doesn't belongs to the generator world and will sooner be moved to APIExtractor
- */
- AbstractMetaFunctionList sortConstructor(AbstractMetaFunctionList list) GENRUNNER_DEPRECATED;
- /**
- * Returns the code snips of a function
- * \deprecated Use AbstractMetaFunction::injectedCodeSnips() instead.
- */
- CodeSnipList getCodeSnips(const AbstractMetaFunction *func) const GENRUNNER_DEPRECATED;
- /**
- * @deprecated This function doesn't belongs to the generator world and will sooner be moved to APIExtractor
- */
- bool hasDefaultConstructor(const AbstractMetaType *type) GENRUNNER_DEPRECATED;
-
private:
struct GeneratorPrivate;
GeneratorPrivate* m_d;
diff --git a/generators/qtdoc/qtdocgenerator.cpp b/generators/qtdoc/qtdocgenerator.cpp
index 4b5e9d47..9d56dae4 100644
--- a/generators/qtdoc/qtdocgenerator.cpp
+++ b/generators/qtdoc/qtdocgenerator.cpp
@@ -911,7 +911,7 @@ void QtDocGenerator::generateClass(QTextStream &s, const AbstractMetaClass *cppC
<< " :parts: 2" << endl << endl; // TODO: This would be a parameter in the future...
//Function list
- AbstractMetaFunctionList functionList = filterFunctions(cppClass);
+ AbstractMetaFunctionList functionList = cppClass->functions();
qSort(functionList.begin(), functionList.end(), functionSort);
doc_s << "Detailed Description\n"
@@ -1230,7 +1230,7 @@ void QtDocGenerator::writeInjectDocumentation(QTextStream &s,
s << endl;
if (func) {
- writeDocSnips(s, getCodeSnips(func),
+ writeDocSnips(s, func->injectedCodeSnips(),
(mode == DocModification::Prepend ? CodeSnip::Beginning : CodeSnip::End),
TypeSystem::TargetLangCode);
} else {