<table><tr><td style="">davidedmundson edited the summary of this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-ur2xrgshbohxnva/" rel="noreferrer">(Show Details)</a>
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D8495" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>CHANGES TO REVISION SUMMARY</strong><div><div style="white-space: pre-wrap; color: #74777D;"><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);"> Avoid double-lookup in UdevManager::devicesFromQuery<br />
<br />
</span>The current code <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">fetch</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">instantiat</span>es a<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">ll devices</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);"> list of Udev objects</span>, <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">filters isOfInterest (which is at</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">creates a</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">least one device property lookup) then filters by type.<br />
<br />
If we're searching for a specific type, we can do it much faster if we</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">stringlist of IDs discarding the backend devices. Then we loop through<br />
creating a solid wrapper which then creates the Udev device by ID,</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">fetch devices by type from udev directly, and then filter the irrelevant</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">forcing udev to reload the data for that object again.</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">ones.<br />
<br />
KIO lik</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);"> <br />
This code creat</span>es t<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">o search for media players. According to hotspot this is a</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">he solid wrapper directly from the original<br />
UdevDevice list.</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">really sore point in applications.<br />
<br />
The filter logic is copied from UdevDevice, but applied in the initial</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);"> <br />
The isOfInterest check then needs to be added in this loop.<br />
As it's slower than checking the type so this is done after</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">fetch. ParentUDI was hardcoded in UdevDevice so is here too</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">we check the types match</span>.</div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R245 Solid</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D8495" rel="noreferrer">https://phabricator.kde.org/D8495</a></div></div><br /><div><strong>To: </strong>davidedmundson<br /><strong>Cc: </strong>Frameworks<br /></div>