<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 />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On August 28th, 2013, 3:31 p.m. UTC, <b>Kevin Ottens</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<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/2/?file=178383#file178383line73" style="color: black; font-weight: bold; text-decoration: underline;">tier1/solid/src/declarative/devices.h</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

    </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">73</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">isEmpty</span> <span class="n">READ</span> <span class="n">isEmpty</span> <span class="n">NOTIFY</span> <span class="n">isEmptyChanged</span><span class="p">)</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Should be "empty" for the property name.</pre>
 </blockquote>



 <p>On August 29th, 2013, 10:58 a.m. UTC, <b>Ivan Čukić</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I took it from QList and QString - both have isEmpty, while QList has empty() for STL compatibility.

Sure it should be without 'is'?</pre>
 </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I know the C++ API uses the "is" prefix. But the QML one not (go figure) and since that's intended to be used there.</pre>
<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>