<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/109521/">http://git.reviewboard.kde.org/r/109521/</a>
</td>
</tr>
</table>
<br />
<table bgcolor="#e0e0e0" width="100%" cellpadding="8" style="border: 1px gray solid;">
<tr>
<td>
<h1 style="margin-right: 0.2em; padding: 0; font-size: 10pt;">This change has been discarded.</h1>
</td>
</tr>
</table>
<br />
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Solid.</div>
<div>By Alexander Mezin.</div>
<p style="color: grey;"><i>Updated May 1, 2013, 2:33 p.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Current cache in UDisks2 has two problems: it isn't thread-safe and it introduces "backend objects" for objects that are backends themselves.
Backends and interfaces created through Solid::Device are already shared in thread-safe way, and I think it's better to use this for caching. Also, if DevicePrivates will be cached, all Iface objects will be cached too. The only thing needed is QMap with strong pointers to keep DevicePrivates alive.
This way DeviceBackends could be eliminated. Also, this cache could be easily used by another backends.
The only problem is that objects like UDisks2::Device are sometimes explicitly created in UDisks2 backend code, but this could be fixed later. Seems that almost every time UDisks2::Device can be replaced with Solid::Device.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">After applying this patch to kdelibs 4.10.1, Solid::UDisks2::createDevice is called only once for every device. When the device is replaced, createDevice is called again. Tested on Dolphin using qDebug() :)
Before patching, createDevice was called multiple times.
Didn't see any regressions.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>solid/solid/devicemanager.cpp <span style="color: grey">(a465169)</span></li>
<li>solid/solid/devicemanager_p.h <span style="color: grey">(0d8bd8e)</span></li>
<li>solid/solid/backends/udisks2/udisksmanager.h <span style="color: grey">(fb929ce)</span></li>
<li>solid/solid/ifaces/devicemanager.h <span style="color: grey">(3488d0b)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/109521/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>