Summary: | JJ: remove QPointer usage, port to QWeakPointer | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Milian Wolff <mail> |
Component: | general | Assignee: | kdevelop-bugs-null |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | aleixpol, gkaukola, res.nath |
Priority: | NOR | Keywords: | junior-jobs |
Version: | git master | ||
Target Milestone: | 4.2.0 | ||
Platform: | Unlisted Binaries | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
A small patch
The final patch |
Description
Milian Wolff
2010-12-17 22:19:59 UTC
Is this just a simple "find and replace" QPointer with QWeakPointer? Or are there syntactical differences? Most of the time it's just find and replace, but accessing it is not the same: QPointer can be used as-is, while QWeakPointer must be dereferenced explicitly with .data() Also this is quite low priority as there are (hopefully) not much more cases where QPointer is used so extensively compared to the BackgroundParser. Still, it would be better so patches welcome. Created attachment 55280 [details]
A small patch
I've start working on this. Here is a (small) patch who convert QPointer to QWeakPointer in kdevelop/debuggers/gdb/debugsession.{h,cpp}. Tell me if this patch is Ok, and if yes I will continue.
Created attachment 55281 [details]
The final patch
Finally, I converted all QPointer before you answer. This must remove all QPointer from KDevelop.
The sources build but I haven't try to run KDevelop.
please Nathanael and anyone else interested, please use reviewboard to send in patches: http://git.reviewboard.kde.org Some notes on your patch already: - it shows that in GDB the pointer was used quite a lot without being checked, you should do that at the start of each function, or at least Q_ASSERT on it. - + handler_this.clear(); in the ctor doesn't make any sense, just leave it out, the QWeakPointer ctor will init itself properly and of course we need to test it :) Thanks already Review request created at http://git.reviewboard.kde.org/r/100252/ for anybody else: there are still QPointer occurrences in our code base, to find them do e.g.: git grep QPointer origin master on either kdevelop or kdevplatform I have a diff up on the review board: https://git.reviewboard.kde.org/r/101420/ I'm not entirely sure I went about things right, so if someone could have a look. Committed, with the changes suggested from the review board. I'll try and get to the rest of the QPointer usage here in the next few days. These reviews where committed. |