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.

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.

REPOSITORY
  R33 KDevPlatform

BRANCH
  usestaticcastwhensure

REVISION DETAIL
  https://phabricator.kde.org/D6404

To: kossebau, #kdevelop, kfunk
Cc: kfunk, kdevelop-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20170705/56237ea5/attachment.html>


More information about the KDevelop-devel mailing list