D26267: Replace deprecated QWeakPointer::data() with .toStrongRef().data()

Hugo Pereira Da Costa noreply at phabricator.kde.org
Sun Dec 29 22:42:46 GMT 2019


hpereiradacosta added a comment.


  In D26267#584400 <https://phabricator.kde.org/D26267#584400>, @ndavis wrote:
  
  > In D26267#584396 <https://phabricator.kde.org/D26267#584396>, @hpereiradacosta wrote:
  >
  > > -1:
  > >  if QWeakPointer::data() is obsoleted, (while needed in the code), I would object to adding toStrongRef, in between, since as pointed out by Antony, calling data immediately after brings no further security, and just results in some overhead (Weak to shared pointer). It means that either
  > >
  > > - weakPointer::data should not be obsoleted
  > > - the kdecoration api should be changed (to return shared pointers, or provide direct access to the data).
  >
  >
  > So this patch is not the correct thing to do at all, even if I make the changes @anthonyfieroni suggested. I doubt getting Qt to undeprecate QWeakPointer::data() is an option, so it seems like changing KDecoration would be the correct thing to do. Does that seem correct to you?
  
  
  That's my understanding yes. As long as access to the true data is needed (here for signal/slot connections) by the customers of kdecoration, then kdecoration must provide this access, without roundtrips to shared pointers. 
  Others please correct me if I am wrong.

REPOSITORY
  R31 Breeze

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

To: ndavis, #breeze, #plasma
Cc: hpereiradacosta, anthonyfieroni, plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20191229/1d2dcec5/attachment.html>


More information about the Plasma-devel mailing list