path: root/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
diff options
authorMarc Mutz <>2016-09-30 11:53:07 +0200
committerMarc Mutz <>2016-10-28 18:20:08 +0000
commit56734cdf3383837f1fd59f2a0e8b0f39fcce71f3 (patch)
tree34b1d8ea9b57efeb23e1fab7fb435044790fe3b1 /tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
parent4039568837919fa3e172a71950b235fcf1ddedc7 (diff)
QFileSystemModel: improve readability of the renaming code
Instead of calling QHash::value(), inserting the return value into the hash with a different name and only many lines later removing the old node, do the extraction into a QScopedPointer, and the insertion into the hash from the QScopedPoiner, keeping the node update in between the two. Avoids the double-lookup of 'oldName', makes it clearer what's going on, and limits the potential for some return between the insertion under the new name and the removal under the old one sneaking in, which would cause a double-delete later in the dtor. Change-Id: Ia2d1cca77c04708421ccb5e594729ec83de85345 Reviewed-by: Edward Welbourne <>
Diffstat (limited to 'tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp')
0 files changed, 0 insertions, 0 deletions