diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-10-31 08:49:12 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-11-01 17:52:34 +0000 |
commit | f742e21955410b4e3f545a5cdaf6769abfe81922 (patch) | |
tree | 10c6ee08df908137803c51e60fc364dcb87981df | |
parent | d2ccba47962614bc9d7a1422ce22f0fb82b3bd05 (diff) |
shiboken6: Simplify spaces in function signatures
Allow for breaking lines when specifying long signatures.
Task-number: PYSIDE-2500
Change-Id: I83f3f243eb1a1aaab814e96256abe62812cd6c4e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
(cherry picked from commit 22128c3d683bd556fb4efb070dc3fef5878ef9e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | sources/shiboken6/ApiExtractor/typesystemparser.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sources/shiboken6/ApiExtractor/typesystemparser.cpp b/sources/shiboken6/ApiExtractor/typesystemparser.cpp index 1120f9618..d9f550c7c 100644 --- a/sources/shiboken6/ApiExtractor/typesystemparser.cpp +++ b/sources/shiboken6/ApiExtractor/typesystemparser.cpp @@ -1719,7 +1719,7 @@ FunctionTypeEntryPtr for (auto i = attributes->size() - 1; i >= 0; --i) { const auto name = attributes->at(i).qualifiedName(); if (name == signatureAttribute()) - originalSignature = attributes->takeAt(i).value().toString(); + originalSignature = attributes->takeAt(i).value().toString().simplified(); } const QString signature = TypeDatabase::normalizedSignature(originalSignature); @@ -1958,7 +1958,7 @@ bool TypeSystemParser::parseRenameFunction(const ConditionalStreamReader &, const auto name = attributes->at(i).qualifiedName(); if (name == signatureAttribute()) { // Do not remove as it is needed for the type entry later on - signature = attributes->at(i).value().toString(); + signature = attributes->at(i).value().toString().simplified(); } else if (name == renameAttribute()) { rename = attributes->takeAt(i).value().toString(); } @@ -2575,8 +2575,8 @@ bool TypeSystemParser::parseAddFunction(const ConditionalStreamReader &, QString access; for (auto i = attributes->size() - 1; i >= 0; --i) { const auto name = attributes->at(i).qualifiedName(); - if (name == u"signature") { - originalSignature = attributes->takeAt(i).value().toString(); + if (name == signatureAttribute()) { + originalSignature = attributes->takeAt(i).value().toString().simplified(); } else if (name == u"return-type") { returnType = attributes->takeAt(i).value().toString(); } else if (name == staticAttribute()) { @@ -2796,8 +2796,8 @@ bool TypeSystemParser::parseModifyFunction(const ConditionalStreamReader &reader QString rename; for (auto i = attributes->size() - 1; i >= 0; --i) { const auto name = attributes->at(i).qualifiedName(); - if (name == u"signature") { - originalSignature = attributes->takeAt(i).value().toString(); + if (name == signatureAttribute()) { + originalSignature = attributes->takeAt(i).value().toString().simplified(); } else if (name == accessAttribute()) { access = attributes->takeAt(i).value().toString(); } else if (name == renameAttribute()) { @@ -3261,7 +3261,7 @@ bool TypeSystemParser::startElement(const ConditionalStreamReader &reader, Stack if (m_context->db->hasDroppedTypeEntries()) { const QString identifier = element == StackElement::FunctionTypeEntry - ? attributes.value(signatureAttribute()).toString() : name; + ? attributes.value(signatureAttribute()).toString().simplified() : name; if (shouldDropTypeEntry(m_context->db, m_contextStack, identifier)) { m_currentDroppedEntryDepth = 1; if (ReportHandler::isDebug(ReportHandler::SparseDebug)) { |