D17775: [kcmkwin/kwindecoration] Set current decoration index on start

Valerio Pilo <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
vpilo marked an inline comment as done.
vpilo added inline comments.

INLINE COMMENTS

> davidedmundson wrote in kcm.cpp:109
> This is done on line 317.
> 
> What's the advantage of doing it here?
> (Also after this patch who uses savedIndex ?)

It's to prevent "undefined reference" errors in the qml. I could have used `typeof() != "undefined"` in the QML but this is cleaner

> davidedmundson wrote in kcm.cpp:319
> Creating delegates in a grid view is async from setting the model.
> 
> Setting the curentIndex before the delegate is created is the bug that the existing code is trying to fix.
> 
> (even though I agree the current solution is quite wrong)
> 
> A common pattern is to update the grid index inside the delegate constructor

I rewrote the whole thing, thank you for the tip!

> davidedmundson wrote in Previews.qml:64
> why this?

Leftover from my initial investigation

REPOSITORY
  R108 KWin

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

To: vpilo, davidedmundson
Cc: davidedmundson, kwin, GB_2, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, ngraham, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.