Cleanup ViewModel a bit and try to fix crash on exit

Authored by valeriymalov on Sep 22 2019, 6:20 PM.

Description

Cleanup ViewModel a bit and try to fix crash on exit

Summary:
removeTorrent makes changes to torrent list we are currently iterating
on per-item basis, this causees heap-use-after-free in onExit
Just call removeRows which should be functionally the same, but should
delete all items in one batch

CCBUG: 383127

Compact ViewModel::Item::update
Fix a few warnings (0 as nullptr, c-style casts)
Remove useless ViewModel::torrentFromIndex variant
Remove unused headers
add CMakeLists.txt.user to gitignore

Test Plan: build with asan, run & exit, see asan stacktrace before changing onExit

Reviewers: stikonas

Differential Revision: https://phabricator.kde.org/D24149

Details

Committed
valeriymalovSep 29 2019, 8:31 PM
Differential Revision
D24149: Cleanup ViewModel a bit and try to fix crash on exit
Parents
R473:bb3c4d652854: Bump version to 5.1.2.
Branches
Unknown
Tags
Unknown