diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-11-11 09:38:22 +0100 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-11-17 18:14:28 +0100 |
| commit | f499c71c3b3f78920be192d35df7e2c8d18e2f1b (patch) | |
| tree | 1cf53d8b089cfcb054c395bb288951c945f6e582 /sources/shiboken6/ApiExtractor/messages.cpp | |
| parent | cf4f1a7488ba3202b44081eade36debf1d665e8f (diff) | |
shiboken6: Use smart pointers for the TypeEntry classes
TypeEntry instances were previously stored and passed as raw pointers,
which made it difficult to track ownership, particularly when
synthesized classes were added. Change it to use QSharedPointer.
Change-Id: I3612efbc5d467ebeac9aa5dda86c7439bbd03ddd
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/messages.cpp')
| -rw-r--r-- | sources/shiboken6/ApiExtractor/messages.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sources/shiboken6/ApiExtractor/messages.cpp b/sources/shiboken6/ApiExtractor/messages.cpp index 06c10a49b..247bb7db0 100644 --- a/sources/shiboken6/ApiExtractor/messages.cpp +++ b/sources/shiboken6/ApiExtractor/messages.cpp @@ -210,7 +210,7 @@ QString msgUnnamedArgumentDefaultExpression(const AbstractMetaClass *context, return result; } -QString msgClassOfEnumNotFound(const EnumTypeEntry *entry) +QString msgClassOfEnumNotFound(const EnumTypeEntryCPtr &entry) { QString result; QTextStream str(&result); @@ -233,7 +233,7 @@ QString msgNoEnumTypeEntry(const EnumModelItem &enumItem, QString msgNoEnumTypeConflict(const EnumModelItem &enumItem, const QString &className, - const TypeEntry *t) + const TypeEntryCPtr &t) { QString result; QDebug debug(&result); // Use the debug operator for TypeEntry::Type @@ -347,7 +347,7 @@ QString msgSkippingField(const VariableModelItem &field, const QString &classNam static const char msgCompilationError[] = "This could potentially lead to compilation errors."; -QString msgTypeNotDefined(const TypeEntry *entry) +QString msgTypeNotDefined(const TypeEntryCPtr &entry) { QString result; QTextStream str(&result); @@ -356,7 +356,7 @@ QString msgTypeNotDefined(const TypeEntry *entry) return result; } -QString msgGlobalFunctionNotDefined(const FunctionTypeEntry *fte, +QString msgGlobalFunctionNotDefined(const FunctionTypeEntryCPtr &fte, const QString &signature, const QStringList &candidates) { @@ -383,7 +383,7 @@ QString msgStrippingArgument(const FunctionModelItem &f, int i, return result; } -QString msgEnumNotDefined(const EnumTypeEntry *t) +QString msgEnumNotDefined(const EnumTypeEntryCPtr &t) { QString result; QTextStream str(&result); @@ -676,13 +676,13 @@ QString msgConversionTypesDiffer(const QString &varType, const QString &conversi return result; } -QString msgCannotFindSmartPointerGetter(const SmartPointerTypeEntry *te) +QString msgCannotFindSmartPointerGetter(const SmartPointerTypeEntryCPtr &te) { return u"Getter \""_s + te->getter() + u"()\" of smart pointer \""_s + te->name() + u"\" not found."_s; } -QString msgCannotFindSmartPointerMethod(const SmartPointerTypeEntry *te, const QString &m) +QString msgCannotFindSmartPointerMethod(const SmartPointerTypeEntryCPtr &te, const QString &m) { return u"Method \""_s + m + u"()\" of smart pointer \""_s + te->name() + u"\" not found."_s; @@ -743,14 +743,14 @@ QString msgCyclicDependency(const QString &funcName, const QString &graphName, // shibokengenerator.cpp -QString msgClassNotFound(const TypeEntry *t) +QString msgClassNotFound(const TypeEntryCPtr &t) { return u"Could not find class \""_s + t->qualifiedCppName() + u"\" in the code model. Maybe it is forward declared?"_s; } -QString msgEnclosingClassNotFound(const TypeEntry *t) +QString msgEnclosingClassNotFound(const TypeEntryCPtr &t) { QString result; QTextStream str(&result); @@ -922,14 +922,14 @@ QString msgInvalidTargetLanguageApiName(const QString &name) + name + u"\"."_s; } -QString msgUnknownCheckFunction(const TypeEntry *t) +QString msgUnknownCheckFunction(const TypeEntryCPtr &t) { return u"Unknown check function for type: '"_s + t->qualifiedCppName() + u"'."_s; } QString msgArgumentClassNotFound(const AbstractMetaFunctionCPtr &func, - const TypeEntry *t) + const TypeEntryCPtr &t) { QString result; QTextStream(&result) << "Internal Error: Class \"" << t->qualifiedCppName() @@ -937,7 +937,7 @@ QString msgArgumentClassNotFound(const AbstractMetaFunctionCPtr &func, return result; } -QString msgMissingCustomConversion(const TypeEntry *t) +QString msgMissingCustomConversion(const TypeEntryCPtr &t) { QString result; QTextStream(&result) << "Entry \"" << t->qualifiedCppName() |
