<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/111964/">http://git.reviewboard.kde.org/r/111964/</a>
     </td>
    </tr>
   </table>
   <br />





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">What's funny is that it looks fairly close from the code which would have to be written for the "smart device list" I discussed with Alex a couple of years ago. It'd have to be split in two and then the part independent from QML would need to be thread safe.

Note: I'm not asking you to do that, it's just for future reference.</pre>
 <br />







<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="http://git.reviewboard.kde.org/r/111964/diff/3/?file=185574#file185574line75" style="color: black; font-weight: bold; text-decoration: underline;">tier1/solid/src/imports/devices.h</a>
    <span style="font-weight: normal;">

     (Diff revision 3)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">75</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">Q_PROPERTY</span><span class="p">(</span><span class="kt">bool</span> <span class="n">empty</span> <span class="n">READ</span> <span class="n">empty</span> <span class="n">NOTIFY</span> <span class="n">emptyChanged</span><span class="p">)</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Ah OK, I get where the confusion comes from. :-)

The property should be named "empty" the getter is still named "isEmpty".</pre>
</div>
<br />

<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="http://git.reviewboard.kde.org/r/111964/diff/3/?file=185574#file185574line136" style="color: black; font-weight: bold; text-decoration: underline;">tier1/solid/src/imports/devices.h</a>
    <span style="font-weight: normal;">

     (Diff revision 3)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">136</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="kt">bool</span> <span class="n">empty</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">So isEmpty here.</pre>
</div>
<br />

<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="http://git.reviewboard.kde.org/r/111964/diff/3/?file=185574#file185574line184" style="color: black; font-weight: bold; text-decoration: underline;">tier1/solid/src/imports/devices.h</a>
    <span style="font-weight: normal;">

     (Diff revision 3)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">184</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="c1">// </span><span class="cs">TODO</span><span class="c1">: Should this be thread-safe?</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">For now it'll be all in a single thread so you should be fine. But who knows what will come with Qt Quick 26 and KF42?? ;-)</pre>
</div>
<br />

<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="http://git.reviewboard.kde.org/r/111964/diff/3/?file=185574#file185574line186" style="color: black; font-weight: bold; text-decoration: underline;">tier1/solid/src/imports/devices.h</a>
    <span style="font-weight: normal;">

     (Diff revision 3)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">186</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">mutable</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I think we generally put mutable on the same line than the rest of the declaration (kind of part of the type name).</pre>
</div>
<br />



<p>- Kevin</p>


<br />
<p>On August 29th, 2013, 10:57 a.m. UTC, Ivan Čukić wrote:</p>








<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, Àlex Fiestas, Aleix Pol Gonzalez, David Edmundson, and Kevin Ottens.</div>
<div>By Ivan Čukić.</div>


<p style="color: grey;"><i>Updated Aug. 29, 2013, 10:57 a.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;">revision 0:

This one will need more review and discussion - it exposes some of Solid functionality to QML.

The reason Solid classes are not exported directly is that they don't tend to have a no-arg constructor, and some of them are not QObjects.

It registers a class (org.kde.solid.)Devices (initially modelled after DeviceNotifier) that contains the following features:
 - ability to list all devices or just those that match a defined query (Solid::Predicate)
 - signals for when devices that match the query are added or deleted
 - isEmpty property - are there no devices that match the query?
 - count property - the number of devices that match the query
 - devices property - a list of udis of the devices that match the query
 - device method that returns a QObject interface to the device.

The things I'm in doubt about:

1. devices property and device(...) method are similarly named, while one gets udis, and the other actual DeviceInterface object.

Possible solutions:
 - devices -> udis or deviceUdis
 - device(...) -> deviceInterface(...) or something else

2. If the user creates two instances with the same query, both instances will contain a query and a Solid::Predicate, the query will be parsed two times and similar.

The implementation could be complicated a bit by creating private parts of instances with the same queries to be shared, but is it worth it?

revision 1:

Shared backends when two Devices objects have a same query.</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;">Yes. Created a test QML application.</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>tier1/solid/src/CMakeLists.txt <span style="color: grey">(c3c462f)</span></li>

 <li>tier1/solid/src/imports/CMakeLists.txt <span style="color: grey">(PRE-CREATION)</span></li>

 <li>tier1/solid/src/imports/devices.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>tier1/solid/src/imports/devices.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>tier1/solid/src/imports/devices_p.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>tier1/solid/src/imports/qmldir <span style="color: grey">(PRE-CREATION)</span></li>

 <li>tier1/solid/src/imports/solidextensionplugin.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>tier1/solid/src/imports/solidextensionplugin.cpp <span style="color: grey">(PRE-CREATION)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/111964/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>