D6404: Use static_cast when sure about the result
Friedrich W. H. Kossebau
noreply at phabricator.kde.org
Wed Jul 5 17:46:30 UTC 2017
kossebau marked an inline comment as done.
kossebau added inline comments.
> kfunk wrote in kdevdocumentview.cpp:257
> Looks like we should rather `Q_ASSERT(fileItem)` here?
Rather no, `fileItem` is allowed to be nullptr. If something could be tested, `dynamic_cast<KDevDocumentItem*>` would be it, though there is no real danger some none-KDevDocumentItem is coming from the model,
But actually that whole code rather should be redone, as `fileitem()` does some kind of dynamic casting as well, as only `KDevFileItem` implements it. Possibly code from before RTII was a okay thing. Left for someone else/some other idle time.
To: kossebau, #kdevelop, kfunk
Cc: kfunk, kdevelop-devel
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the KDevelop-devel