summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-11-09 16:38:19 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-01-26 11:20:58 +0000
commit2c26d519e2c430ec179107addfa414e172ec7ab8 (patch)
treeb3bc52b940c2a95ae92909ccc970ef62384a8698 /lib
parentb8c32f5efc4ac2acf453fb8ecd4a72059abf678c (diff)
moc: simplify finding required Qt containers
The old code searched for any Qt containers by looking at - each class definition - each property's type - each function (signal, slot, method) - each argument type and matching each against "Container<", building the pattern string each time through the loop. It would then collect hits in a QSet to be converted to a QList and sorted at the very end. The new code pulls the iteration over the candidates out of all other loops. By doing so, it can stop looking at classes, properties, functions etc when it finds the first hit, and it inserts every candidate at most once. By iterating over the statically-known list of candidates, the result is not a sorted set of Qt containers, as before, but it still has s fixed order across runs, which was the purpose of the sorting in the original code. In the implementation, make liberal use of C++11 range-for, which is safe, as we're passing everything around as const. Change-Id: If76dd3f57aa1b544a9cf1de2dca94ca7999220f0 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions