aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/ApiExtractor')
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetalang.cpp4
-rw-r--r--sources/shiboken2/ApiExtractor/parser/codemodel.cpp29
-rw-r--r--sources/shiboken2/ApiExtractor/parser/codemodel.h2
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testmodifyfunction.cpp12
4 files changed, 39 insertions, 8 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
index e6590e2dc..00031ab5d 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
+++ b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
@@ -814,9 +814,11 @@ bool AbstractMetaFunction::allowThread() const
case TypeSystem::AllowThread::Allow:
break;
case TypeSystem::AllowThread::Auto:
- case TypeSystem::AllowThread::Unspecified:
result = autoDetectAllowThread();
break;
+ case TypeSystem::AllowThread::Unspecified:
+ result = false;
+ break;
}
if (!result)
qCDebug(lcShiboken).noquote() << msgDisallowThread(this);
diff --git a/sources/shiboken2/ApiExtractor/parser/codemodel.cpp b/sources/shiboken2/ApiExtractor/parser/codemodel.cpp
index c87dd0174..4a69948da 100644
--- a/sources/shiboken2/ApiExtractor/parser/codemodel.cpp
+++ b/sources/shiboken2/ApiExtractor/parser/codemodel.cpp
@@ -393,6 +393,33 @@ void TypeInfo::simplifyStdType()
}
}
+void TypeInfo::formatTypeSystemSignature(QTextStream &str) const
+{
+ if (m_constant)
+ str << "const ";
+ str << m_qualifiedName.join(QLatin1String("::"));
+ switch (m_referenceType) {
+ case NoReference:
+ break;
+ case LValueReference:
+ str << '&';
+ break;
+ case RValueReference:
+ str << "&&";
+ break;
+ }
+ for (auto i : m_indirections) {
+ switch (i) {
+ case Indirection::Pointer:
+ str << '*';
+ break;
+ case Indirection::ConstPointer:
+ str << "* const";
+ break;
+ }
+ }
+}
+
#ifndef QT_NO_DEBUG_STREAM
template <class It>
void formatSequence(QDebug &d, It i1, It i2, const char *separator=", ")
@@ -1145,7 +1172,7 @@ QString _FunctionModelItem::typeSystemSignature() const // For dumping out type
for (int a = 0, size = m_arguments.size(); a < size; ++a) {
if (a)
str << ',';
- str << m_arguments.at(a)->type().qualifiedName().join(QLatin1String("::"));
+ m_arguments.at(a)->type().formatTypeSystemSignature(str);
}
str << ')';
return result;
diff --git a/sources/shiboken2/ApiExtractor/parser/codemodel.h b/sources/shiboken2/ApiExtractor/parser/codemodel.h
index 028dbc7e4..cfe2e055c 100644
--- a/sources/shiboken2/ApiExtractor/parser/codemodel.h
+++ b/sources/shiboken2/ApiExtractor/parser/codemodel.h
@@ -202,6 +202,8 @@ public:
static TypeInfo combine(const TypeInfo &__lhs, const TypeInfo &__rhs);
static TypeInfo resolveType(TypeInfo const &__type, const ScopeModelItem &__scope);
+ void formatTypeSystemSignature(QTextStream &str) const;
+
#ifndef QT_NO_DEBUG_STREAM
void formatDebug(QDebug &d) const;
#endif
diff --git a/sources/shiboken2/ApiExtractor/tests/testmodifyfunction.cpp b/sources/shiboken2/ApiExtractor/tests/testmodifyfunction.cpp
index 922f1c23f..4fd4269f6 100644
--- a/sources/shiboken2/ApiExtractor/tests/testmodifyfunction.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testmodifyfunction.cpp
@@ -256,9 +256,9 @@ struct A {
// Nothing specified, true
const AbstractMetaFunction *f1 = classA->findFunction(QLatin1String("f1"));
QVERIFY(f1);
- QVERIFY(f1->allowThread());
+ QVERIFY(!f1->allowThread());
- // 'auto' specified, should be true for nontrivial function
+ // 'auto' specified, should be false for nontrivial function
const AbstractMetaFunction *f2 = classA->findFunction(QLatin1String("f2"));
QVERIFY(f2);
QVERIFY(f2->allowThread());
@@ -349,7 +349,7 @@ struct A : public Base {
<object-type name='A'/>
</typesystem>)XML")
<< false << false << false // exception
- << true; // allowthread
+ << false; // allowthread
// Modify one function
QTest::newRow("modify-function1")
@@ -363,7 +363,7 @@ struct A : public Base {
</object-type>
</typesystem>)XML")
<< false << false << true // exception
- << true; // allowthread
+ << false; // allowthread
// Flip defaults by modifying functions
QTest::newRow("modify-function2")
@@ -378,7 +378,7 @@ struct A : public Base {
</object-type>
</typesystem>)XML")
<< true << false << false // exception
- << true; // allowthread
+ << false; // allowthread
// Activate on type system level
QTest::newRow("typesystem-on")
@@ -428,7 +428,7 @@ struct A : public Base {
</object-type>
</typesystem>)XML")
<< true << false << false // exception
- << true; // allowthread
+ << false; // allowthread
}
void TestModifyFunction::testScopedModifications()