Wireshark-dev: [Wireshark-dev] Inclusion of KDE code in WS
From: Roland Knall <rknall@xxxxxxxxx>
Date: Wed, 28 Dec 2016 09:37:38 +0100
Hi

Short question: 
Would it be ok, to include 3 KDE classes (from git://anongit.kde.org/kitemmodels.git) with the WS sourcecode, after asking the author (single author in this case) if this is ok? The code is licensed with GPL 2.1

Long question:
I am running into a rather difficult issue with the view/model concept. As the new interface tree makes excessive use of the proxymodels (as it should do), it makes sense to share selections between views. We do this right now using signal/slots, which leads to an overhead in the programmcode, but also an overhead in time, as each signal/slot is run in a different thread. 

The solution for this is rather simple in theory, selectionmodels (which handle selection in a model) can be shared. This is done on quite a few occasions in the code already. Now, with proxy models sharing the selectionmodels use different indeces, as their underlying datamodel differs. But all those data models have the same parent (although after quite a few models in between). In the above mentioned source, Stephen Kelly wrote a KModelIndexProxyMapper which is portable, independent and GPL-licensed, which achieves exactly what is needed here.

We could implement our own version (heavily written off the KDE version but mentioning and referring to it), or just copy their code, as it is quite good.

regards,
Roland