D20198: Don't lose list position after installing KNS cursor themes

Dan Leinir Turthra Jensen noreply at phabricator.kde.org
Wed Apr 3 08:51:19 BST 2019


leinir added a comment.


  In D20198#442364 <https://phabricator.kde.org/D20198#442364>, @ngraham wrote:
  
  > Why do we need this do-it-once helper function?
  
  
  To avoid having the lambda being called multiple times for subsequent installations, especially with incorrect parameters... It's a bit of a workaround for some missing metaprogramming abilities in C++/Qt that Discover also uses in a couple of places, it's quite handy and i can't help but think it wants to be somewhere more centrally available, but i also am not sure where that'd want to be ;)

INLINE COMMENTS

> apol wrote in kcmcursortheme.cpp:466
> This reads weird: how about:
> 
>   if (selectedIndex().isValid()) {
>       const CursorTheme* theme = m_proxyModel->theme(selectedIndex());
>       ...
>   }

Thanks @ngraham :)

Good point @apol, it's a straight up copy from the save() function, and i'd just not unpacked it all the way. Yes, that definitely reads better, i'll swap it for that :)

> apol wrote in kcmcursortheme.h:150
> :) this sounds familiar.
> 
> Maybe we should keep this in the cpp file? it's only used there.

It certainly does ;) Hmm... true, it doesn't actually need moc-ing, at least when using the modern connect syntax like is being done here, so... yup, i'll pop it in there :)

REPOSITORY
  R119 Plasma Desktop

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

To: leinir, #plasma, ngraham, broulik
Cc: apol, plasma-devel, #plasma, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190403/39fcf849/attachment-0001.html>


More information about the Plasma-devel mailing list