aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/generator/shiboken/cppgenerator.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-12-19 19:22:16 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-12-20 17:40:55 +0100
commit638bc0e5e8f0400411c6ba0fb40ddcde6d3a7c40 (patch)
tree409fb999682218deb186aa5f817d8391f8df6d6b /sources/shiboken6/generator/shiboken/cppgenerator.cpp
parente99ac18b134469854dff05fd3bb61158f9d9ccf9 (diff)
shiboken6: Do not sort classes unnecessarily
The list of classes was first sorted topologically, then alphabetically in the AbstractMetaBuilder and finally again topologically in the CppGenerator with an additional dependency QObiect/QMetaObject. Move the sort functionality taking the QObiect/QMetaObject dependency into account from the generator to the AbstractMetaBuilder. Move all sorting functionality to helper sortLists(). The classesTopologicalSorted() helper is then no longer needed by the generators and can be removed from the ApiExtractor. Pick-to: 6.0 Change-Id: I03c799118296393bdd0f3de84427b50ab29153b0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken6/generator/shiboken/cppgenerator.cpp')
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator.cpp16
1 files changed, 1 insertions, 15 deletions
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
index d522db846..766ef25d9 100644
--- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
@@ -5929,21 +5929,7 @@ bool CppGenerator::finishGeneration()
writeMethodDefinition(s_globalFunctionDef, overloads);
}
- //this is a temporary solution before new type revison implementation
- //We need move QMetaObject register before QObject
- Dependencies additionalDependencies;
- const AbstractMetaClassList &allClasses = classes();
- if (auto qObjectClass = AbstractMetaClass::findClass(allClasses, qObjectT())) {
- if (auto qMetaObjectClass = AbstractMetaClass::findClass(allClasses, qMetaObjectT())) {
- Dependency dependency;
- dependency.parent = qMetaObjectClass;
- dependency.child = qObjectClass;
- additionalDependencies.append(dependency);
- }
- }
- const AbstractMetaClassList lst = classesTopologicalSorted(additionalDependencies);
-
- for (const AbstractMetaClass *cls : lst){
+ for (const AbstractMetaClass *cls : classes()){
if (shouldGenerate(cls)) {
writeInitFunc(s_classInitDecl, s_classPythonDefines,
getSimpleClassInitFunctionName(cls),