diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-10-22 06:57:03 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-10-23 17:27:09 (GMT) |
commit | 1c889cca680b79ca55a69b6dfef2f387f120e2d3 (patch) | |
tree | 1d78d4869a949718823ee9ba0537116262058139 /addon | |
parent | d2f42d48e25872f3fb345b0f1ae7c9f7268d384b (diff) | |
download | Doxygen-1c889cca680b79ca55a69b6dfef2f387f120e2d3.zip Doxygen-1c889cca680b79ca55a69b6dfef2f387f120e2d3.tar.gz Doxygen-1c889cca680b79ca55a69b6dfef2f387f120e2d3.tar.bz2 |
Refactoring: modernize Doxygen::symbolMap
Diffstat (limited to 'addon')
-rw-r--r-- | addon/doxyapp/doxyapp.cpp | 43 |
1 files changed, 8 insertions, 35 deletions
diff --git a/addon/doxyapp/doxyapp.cpp b/addon/doxyapp/doxyapp.cpp index f9356c8..3ec8fb2 100644 --- a/addon/doxyapp/doxyapp.cpp +++ b/addon/doxyapp/doxyapp.cpp @@ -148,25 +148,9 @@ static void listSymbol(Definition *d) static void listSymbols() { - QDictIterator<DefinitionIntf> sli(*Doxygen::symbolMap); - DefinitionIntf *di; - for (sli.toFirst();(di=sli.current());++sli) + for (const auto &kv : Doxygen::symbolMap) { - if (di->definitionType()==DefinitionIntf::TypeSymbolList) // list of symbols - // with same name - { - DefinitionListIterator dli(*(DefinitionList*)di); - Definition *d; - // for each symbol - for (dli.toFirst();(d=dli.current());++dli) - { - listSymbol(d); - } - } - else // single symbol - { - listSymbol((Definition*)di); - } + listSymbol(kv.second); } } @@ -223,25 +207,14 @@ static void lookupSymbols(const QCString &sym) { if (!sym.isEmpty()) { - DefinitionIntf *di = Doxygen::symbolMap->find(sym); - if (di) + auto range = Doxygen::symbolMap.find(sym); + bool found=false; + for (auto it=range.first; it!=range.second; ++it) { - if (di->definitionType()==DefinitionIntf::TypeSymbolList) - { - DefinitionListIterator dli(*(DefinitionList*)di); - Definition *d; - // for each symbol with the given name - for (dli.toFirst();(d=dli.current());++dli) - { - lookupSymbol(d); - } - } - else - { - lookupSymbol((Definition*)di); - } + lookupSymbol(it->second); + found=true; } - else + if (!found) { printf("Unknown symbol\n"); } |