Version: SVN OS: Linux QPointer is slow and QWeakPointer should be used instead. I've done this now for the background parser as it showed a bottleneck for at least one of our users. All other usages should be ported as well. Reproducible: Didn't try
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.
https://git.reviewboard.kde.org/r/101587/
https://git.reviewboard.kde.org/r/101588/
These reviews where committed.