@@ -741,7 +741,7 @@ static Definition *buildScopeFromQualifiedName(const QCString &name_,SrcLangExt
741
741
else if (nd==0 && cd==0 && fullScope.find (' <' )==-1 ) // scope is not known and could be a namespace!
742
742
{
743
743
// introduce bogus namespace
744
- // printf("++ adding dummy namespace %s to %s tagInfo=%p\n",qPrint(nsName),qPrint(prevScope->name()),tagInfo);
744
+ // printf("++ adding dummy namespace %s to %s tagInfo=%p\n",qPrint(nsName),qPrint(prevScope->name()),(void*) tagInfo);
745
745
NamespaceDefMutable *newNd=
746
746
toNamespaceDefMutable (
747
747
Doxygen::namespaceLinkedMap->add (fullScope,
@@ -1976,15 +1976,16 @@ static void buildListOfUsingDecls(const Entry *root)
1976
1976
}
1977
1977
1978
1978
1979
- static void findUsingDeclarations (const Entry *root)
1979
+ static void findUsingDeclarations (const Entry *root, bool filterPythonPackages )
1980
1980
{
1981
1981
if (root->section ==Entry::USINGDECL_SEC &&
1982
- !(root->parent ()->section &Entry::COMPOUND_MASK) // not a class/struct member
1982
+ !(root->parent ()->section &Entry::COMPOUND_MASK) && // not a class/struct member
1983
+ (!filterPythonPackages || (root->lang ==SrcLangExt_Python && root->fileName .endsWith (" __init__.py" )))
1983
1984
)
1984
1985
{
1985
1986
// printf("Found using declaration %s at line %d of %s inside section %x\n",
1986
1987
// qPrint(root->name),root->startLine,qPrint(root->fileName),
1987
- // rootNav ->parent()->section() );
1988
+ // root ->parent()->section);
1988
1989
if (!root->name .isEmpty ())
1989
1990
{
1990
1991
ClassDefMutable *usingCd = 0 ;
@@ -2023,7 +2024,7 @@ static void findUsingDeclarations(const Entry *root)
2023
2024
usingCd = toClassDefMutable (Doxygen::hiddenClassLinkedMap->find (name)); // check if it is already hidden
2024
2025
}
2025
2026
2026
- // printf("%s -> %p\n",qPrint(root->name),usingCd);
2027
+ // printf("%s -> %p\n",qPrint(root->name),(void*) usingCd);
2027
2028
if (usingCd==0 ) // definition not in the input => add an artificial class
2028
2029
{
2029
2030
Debug::print (Debug::Classes,0 ," New using class '%s' (sec=0x%08x)! #tArgLists=%d\n " ,
@@ -2059,7 +2060,7 @@ static void findUsingDeclarations(const Entry *root)
2059
2060
}
2060
2061
}
2061
2062
}
2062
- for (const auto &e : root->children ()) findUsingDeclarations (e.get ());
2063
+ for (const auto &e : root->children ()) findUsingDeclarations (e.get (),filterPythonPackages );
2063
2064
}
2064
2065
2065
2066
// ----------------------------------------------------------------------
@@ -9935,6 +9936,13 @@ static void readDir(FileInfo *fi,
9935
9936
}
9936
9937
}
9937
9938
}
9939
+ if (resultList)
9940
+ {
9941
+ // sort the resulting list to make the order platform independent.
9942
+ std::sort (resultList->begin (),
9943
+ resultList->end (),
9944
+ [](const auto &f1,const auto &f2) { return qstricmp (f1.c_str (),f2.c_str ())<0 ; });
9945
+ }
9938
9946
}
9939
9947
9940
9948
@@ -11515,7 +11523,8 @@ void parseInput()
11515
11523
g_s.begin (" Searching for members imported via using declarations...\n " );
11516
11524
// this should be after buildTypedefList in order to properly import
11517
11525
// used typedefs
11518
- findUsingDeclarations (root.get ());
11526
+ findUsingDeclarations (root.get (),TRUE ); // do for python packages first
11527
+ findUsingDeclarations (root.get (),FALSE ); // then the rest
11519
11528
g_s.end ();
11520
11529
11521
11530
g_s.begin (" Searching for included using directives...\n " );
0 commit comments